Skip to content

Commit

Permalink
Don't highlight spaces.
Browse files Browse the repository at this point in the history
  • Loading branch information
schungx committed May 28, 2024
1 parent 19c50ec commit e4055c9
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 2 deletions.
4 changes: 4 additions & 0 deletions syntax/rhai.JSON-tmLanguage
Original file line number Diff line number Diff line change
Expand Up @@ -596,6 +596,10 @@
"name": "keyword.operator.logical.rhai",
"match": "(?x)\n !(?!=)| # logical-not right-to-left right\n && | # logical-and left-to-right both\n \\|\\| # logical-or left-to-right both"
},
{
"name": "keyword.operator.containment.rhai",
"match": "(?x)\n \\bin\\b | # in left-to-right both\n \\B!in\\b # not-in left-to-right both"
},
{
"name": "keyword.operator.coalesce.rhai",
"match": "(?x)\n \\?\\? # null-coalesce left-to-right both"
Expand Down
5 changes: 5 additions & 0 deletions syntax/rhai.YAML-tmLanguage
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,11 @@ repository:
!(?!=)| # logical-not right-to-left right
&& | # logical-and left-to-right both
\|\| # logical-or left-to-right both
- name: keyword.operator.containment.rhai
match: >-
(?x)
\bin\b | # in left-to-right both
\B!in\b # not-in left-to-right both
- name: keyword.operator.coalesce.rhai
match: >-
(?x)
Expand Down
2 changes: 1 addition & 1 deletion syntax/rhai.configuration.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
"end": "^\\s*//\\s*#?endregion\\b"
}
},
"wordPattern": "[.<>\\0-9a-zA-Z]",
"wordPattern": "(-?\\d*\\.\\d\\w*)|([^\\`\\~\\!\\@\\#\\%\\^\\&\\*\\(\\)\\-\\=\\+\\[\\{\\]\\}\\\\\\|\\;\\:\\'\\\"\\,\\.\\<\\>\\/\\?\\s]+)",
"indentationRules": {
"increaseIndentPattern": "^((?!\\/\\/).)*(\\{[^}\"'`]*|\\([^)\"'`]*|\\[[^\\]\"'`]*)$",
"decreaseIndentPattern": "^((?!.*?\\/\\*).*\\*/)?\\s*[\\}\\]].*$"
Expand Down
4 changes: 4 additions & 0 deletions syntax/rhai.tmLanguage.json
Original file line number Diff line number Diff line change
Expand Up @@ -596,6 +596,10 @@
"name": "keyword.operator.logical.rhai",
"match": "(?x)\n !(?!=)| # logical-not right-to-left right\n && | # logical-and left-to-right both\n \\|\\| # logical-or left-to-right both"
},
{
"name": "keyword.operator.containment.rhai",
"match": "(?x)\n \\bin\\b | # in left-to-right both\n \\B!in\\b # not-in left-to-right both"
},
{
"name": "keyword.operator.coalesce.rhai",
"match": "(?x)\n \\?\\? # null-coalesce left-to-right both"
Expand Down
2 changes: 1 addition & 1 deletion test/switch.rhai
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ let arr = [42, 123.456, "hello", true, "hey", 'x', 999, 1, 2, 3, 4];
for item in arr {
switch item {
// Match single character
'f' => |a, b| a > b,
'f' => |a, b| a !in b,
// Match single integer
42 => print("The Answer!"),
// Match a selection
Expand Down

0 comments on commit e4055c9

Please sign in to comment.