Skip to content

Commit e4055c9

Browse files
committed
Don't highlight spaces.
1 parent 19c50ec commit e4055c9

File tree

5 files changed

+15
-2
lines changed

5 files changed

+15
-2
lines changed

syntax/rhai.JSON-tmLanguage

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -596,6 +596,10 @@
596596
"name": "keyword.operator.logical.rhai",
597597
"match": "(?x)\n !(?!=)| # logical-not right-to-left right\n && | # logical-and left-to-right both\n \\|\\| # logical-or left-to-right both"
598598
},
599+
{
600+
"name": "keyword.operator.containment.rhai",
601+
"match": "(?x)\n \\bin\\b | # in left-to-right both\n \\B!in\\b # not-in left-to-right both"
602+
},
599603
{
600604
"name": "keyword.operator.coalesce.rhai",
601605
"match": "(?x)\n \\?\\? # null-coalesce left-to-right both"

syntax/rhai.YAML-tmLanguage

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,11 @@ repository:
340340
!(?!=)| # logical-not right-to-left right
341341
&& | # logical-and left-to-right both
342342
\|\| # logical-or left-to-right both
343+
- name: keyword.operator.containment.rhai
344+
match: >-
345+
(?x)
346+
\bin\b | # in left-to-right both
347+
\B!in\b # not-in left-to-right both
343348
- name: keyword.operator.coalesce.rhai
344349
match: >-
345350
(?x)

syntax/rhai.configuration.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@
9696
"end": "^\\s*//\\s*#?endregion\\b"
9797
}
9898
},
99-
"wordPattern": "[.<>\\0-9a-zA-Z]",
99+
"wordPattern": "(-?\\d*\\.\\d\\w*)|([^\\`\\~\\!\\@\\#\\%\\^\\&\\*\\(\\)\\-\\=\\+\\[\\{\\]\\}\\\\\\|\\;\\:\\'\\\"\\,\\.\\<\\>\\/\\?\\s]+)",
100100
"indentationRules": {
101101
"increaseIndentPattern": "^((?!\\/\\/).)*(\\{[^}\"'`]*|\\([^)\"'`]*|\\[[^\\]\"'`]*)$",
102102
"decreaseIndentPattern": "^((?!.*?\\/\\*).*\\*/)?\\s*[\\}\\]].*$"

syntax/rhai.tmLanguage.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -596,6 +596,10 @@
596596
"name": "keyword.operator.logical.rhai",
597597
"match": "(?x)\n !(?!=)| # logical-not right-to-left right\n && | # logical-and left-to-right both\n \\|\\| # logical-or left-to-right both"
598598
},
599+
{
600+
"name": "keyword.operator.containment.rhai",
601+
"match": "(?x)\n \\bin\\b | # in left-to-right both\n \\B!in\\b # not-in left-to-right both"
602+
},
599603
{
600604
"name": "keyword.operator.coalesce.rhai",
601605
"match": "(?x)\n \\?\\? # null-coalesce left-to-right both"

test/switch.rhai

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ let arr = [42, 123.456, "hello", true, "hey", 'x', 999, 1, 2, 3, 4];
55
for item in arr {
66
switch item {
77
// Match single character
8-
'f' => |a, b| a > b,
8+
'f' => |a, b| a !in b,
99
// Match single integer
1010
42 => print("The Answer!"),
1111
// Match a selection

0 commit comments

Comments
 (0)