Skip to content

Commit 28ccc90

Browse files
authored
Improve highlighting of bare and raw strings, and add missing unit & operators (#199)
* Add missing unit and operators * Improve highlighting of bare and raw strings
1 parent 46663c6 commit 28ccc90

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

syntaxes/nushell.tmLanguage.json

+7-6
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,20 @@
2020
{ "include": "#string-double-quote" },
2121
{ "include": "#string-interpolated-double" },
2222
{ "include": "#string-interpolated-single" },
23-
{ "include": "#string-bare" },
24-
{ "include": "#string-raw" }
23+
{ "include": "#string-raw" },
24+
{ "include": "#string-bare" }
2525
]
2626
},
2727
"string-escape": {
2828
"match": "\\\\(?:[bfrnt\\\\'\"/]|u[0-9a-fA-F]{4})",
2929
"name": "constant.character.escape.nushell"
3030
},
3131
"string-bare": {
32-
"match": "[^$\\[{(\"',|#\\s|][^\\[\\]{}()\"'\\s#,|]*",
32+
"match": "[^$\\[{(\"',|#\\s|;][^\\[\\]{}()\"'\\s,|;]*",
3333
"name": "string.bare.nushell"
3434
},
3535
"string-raw": {
36-
"begin": "(?<=r)(#+)'",
36+
"begin": "r(#+)'",
3737
"beginCaptures": {
3838
"0": { "name": "punctuation.definition.string.begin.nushell" }
3939
},
@@ -167,7 +167,7 @@
167167
"name": "constant.numeric.nushell"
168168
},
169169
"numbers": {
170-
"match": "(?<![\\w-])[-+]?(?:\\d+|\\d{1,3}(?:_\\d{3})*)(?:\\.\\d*)?(?i:ns|us|ms|sec|min|hr|day|wk|b|kb|mb|gb|tb|pt|eb|zb|kib|mib|gib|tib|pit|eib|zib)?(?:(?![\\w.])|(?=\\.\\.))",
170+
"match": "(?<![\\w-])[-+]?(?:\\d+|\\d{1,3}(?:_\\d{3})*)(?:\\.\\d*)?(?i:ns|us|µs|ms|sec|min|hr|day|wk|b|kb|mb|gb|tb|pt|eb|zb|kib|mib|gib|tib|pit|eib|zib)?(?:(?![\\w.])|(?=\\.\\.))",
171171
"name": "constant.numeric.nushell"
172172
},
173173
"binary": {
@@ -207,7 +207,7 @@
207207
"name": "keyword.control.nushell"
208208
},
209209
"operators-word": {
210-
"match": "(?<= |\\()(?:mod|in|not-in|not|and|or|xor|bit-or|bit-and|bit-xor|bit-shl|bit-shr|starts-with|ends-with)(?= |\\)|$)",
210+
"match": "(?<= |\\()(?:mod|in|not-in|not|and|or|xor|bit-or|bit-and|bit-xor|bit-shl|bit-shr|starts-with|ends-with|like|not-like)(?= |\\)|$)",
211211
"name": "keyword.control.nushell"
212212
},
213213
"operators-symbols": {
@@ -685,6 +685,7 @@
685685
},
686686
{ "include": "#control-keywords" },
687687
{ "include": "#constant-value" },
688+
{ "include": "#string-raw" },
688689
{ "include": "#command" },
689690
{ "include": "#value" }
690691
]

0 commit comments

Comments
 (0)