Skip to content

Commit 11e426a

Browse files
committed
Improve longer operators
Doesn't affect comparison, arithmetic nor logical. In the match `:+` the `+` became redundant, because it's contained in `opchar`. Discovered while working on scala#191.
1 parent e897578 commit 11e426a

File tree

5 files changed

+10
-4
lines changed

5 files changed

+10
-4
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
"build": "npm-run-all build:syntax build:extension",
6161
"build:syntax": "ts-node src/typescript/GenerateTmLanguageFile.ts > ./syntaxes/Scala.tmLanguage.json",
6262
"build:extension": "vsce package --yarn",
63-
"test": "npm-run-all test:*",
63+
"test": "npm-run-all -c test:*",
6464
"test:unit": "vscode-tmgrammar-test -s source.scala -g syntaxes/Scala.tmLanguage.json -t 'tests/unit/**/*.test.scala'",
6565
"test:snap": "vscode-tmgrammar-snap -s source.scala -g syntaxes/Scala.tmLanguage.json -t 'tests/snap/**/*.test.scala'",
6666
"update:snapshots": "vscode-tmgrammar-snap --updateSnapshot -s source.scala -g syntaxes/Scala.tmLanguage.json -t 'tests/snap/**/*.test.scala'"

src/typescript/Scala.tmLanguage.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -689,7 +689,7 @@ export const scalaTmLanguage: TmLanguage = {
689689
name: 'keyword.operator.logical.scala'
690690
},
691691
{
692-
match: '(<-|←|->|→|=>|⇒|\\?|\\:+|@|\\|)+',
692+
match: `(<-|←|->|→|=>|⇒|\\?|\\:|@|\\|)+${opchar}*`,
693693
name: 'keyword.operator.scala'
694694
}
695695
]

syntaxes/Scala.tmLanguage.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

tests/unit/#182.test.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,4 @@
3636
b&&@b
3737
// ^^^ - keyword.operator.logical.scala
3838
b@&&b
39-
// ^^^ - keyword.operator.logical.scala
39+
// ^^^ - keyword.operator.logical.scala

tests/unit/#191.test.scala

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// SYNTAX TEST "source.scala"
2+
3+
seq:+element
4+
// ^^ keyword.operator.scala
5+
setting := value
6+
// ^^ keyword.operator.scala

0 commit comments

Comments
 (0)