Currently operator_identifier includes characters like : (colon), @ (at), and = (equal) even though they cannot be a legal operator without backticks. Having equal etc pushes tree-sitter into falsely thinking some construct to be an infix operation when they are =.
Another complication is Unicode Math symbols, which includes equal sign.
Solution
Remove colon, at, equal sign, and Math symbols from the single-char operator_identifier.
Add back back a few Math symbol unicodes.
All tests pass as-is.
Note
$ scala
Welcome to Scala 3.4.0 (1.8.0_402, Java OpenJDK 64-Bit Server VM).
Type in expressions for evaluation. Or try :help.
scala> def : = 0
-- [E040] Syntax Error: --------------------------------------------------------
1 |def : = 0
| ^
| an identifier expected, but ':' found
|
| longer explanation available when compiling with `-explain`
scala> def @ = 0
-- [E040] Syntax Error: --------------------------------------------------------
1 |def @ = 0
| ^
| an identifier expected, but '@' found
|
| longer explanation available when compiling with `-explain`
scala> def = = 0
-- [E040] Syntax Error: --------------------------------------------------------
1 |def = = 0
| ^
| an identifier expected, but '=' found
|
| longer explanation available when compiling with `-explain`
Problem
Currently
operator_identifier
includes characters like:
(colon),@
(at), and=
(equal) even though they cannot be a legal operator without backticks. Having equal etc pushes tree-sitter into falsely thinking some construct to be an infix operation when they are=
.Another complication is Unicode Math symbols, which includes equal sign.
Solution
operator_identifier
.All tests pass as-is.
Note