Merge pull request #394 from eed3si9n/wip/op

Exclude colon, at, and equal from single opchar
pull/659/head
Chris Kipp 2024-04-15 08:51:25 +07:00 committed by GitHub
commit d3eb6b2382
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 2164 additions and 3 deletions

File diff suppressed because it is too large Load Diff

@ -1484,8 +1484,11 @@ module.exports = grammar({
operator_identifier: $ =>
token(
choice(
// single opchar
/[\-!#%&*+\/\\:<=>?@\u005e\u007c~\p{Sm}\p{So}]/,
// opchar minus colon, equal, at
// Technically speaking, Sm (Math symbols https://www.compart.com/en/unicode/category/Sm)
// should be allowed as a single-characeter opchar, however, it includes `=`,
// so we should to avoid that to prevent bad parsing of `=` as infix term or type.
/[\-!#%&*+\/\\<>?\u005e\u007c~\u00ac\u00b1\u00d7\u00f7\u2190-\u2194\p{So}]/,
seq(
// opchar minus slash
/[\-!#%&*+\\:<=>?@\u005e\u007c~\p{Sm}\p{So}]/,

@ -3,7 +3,7 @@
# This is an integration test to generally check the quality of parsing.
SCALA_SCALA_LIBRARY_EXPECTED=100
SCALA_SCALA_COMPILER_EXPECTED=96
SCALA_SCALA_COMPILER_EXPECTED=97
DOTTY_COMPILER_EXPECTED=85
SYNTAX_COMPLEXITY_CEILING=1400