Skip to content

Commit

Permalink
Update binary_operator_definitions regex to not stylize commented def…
Browse files Browse the repository at this point in the history
…initions

Signed-off-by: Federico Ponzi <[email protected]>
  • Loading branch information
FedericoPonzi committed Jan 23, 2025
1 parent f70e274 commit 0a6e2d8
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
4 changes: 2 additions & 2 deletions languages/tlaplus-grammar.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
}
},
"binary_operator_definitions": {
"match": "(\\w+\\s*(\\(?[-<:>=&@/%#!X\\$\\*\\+\\.\\|\\?\\^\\\\]+\\)?|\\\\[a-z]+\\s)\\s*\\w+)\\s*==(?!==)",
"match": "(?<!\\\\\\*)(\\w+\\s*(\\(?[-<:>=&@\\/%#!X\\$\\*\\+\\.\\|\\?\\^\\\\]+\\)?|\\\\[a-z]+\\s)\\s*\\w+)\\s*==(?!==)",
"captures": {
"1": {
"name": "variable.parameter"
Expand Down Expand Up @@ -171,7 +171,7 @@
},
"patterns": [
{
"include" : "#module"
"include": "#module"
},
{
"include": "#pluscal"
Expand Down
23 changes: 23 additions & 0 deletions tests/suite/languages/tlaplus-grammar-test-issue-361.tla
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// SYNTAX TEST "source.tlaplus" "tlaplus language grammar testcase for binary definitions"

---- MODULE Expect ----
// <---- comment.line
// ^^^^^^ keyword.other
// ^^^^^^ entity.name.class

TODO == FALSE
// <--- support.type.primitive
// ^^^^ support.constant.tlaplus

A == TODO \* B == C
// <- support.type.primitive
// ^^^^ source.tlaplus
// ^^^^^^^^ comment.line

A == TODO \* B = C
// <- support.type.primitive
// ^^^^ source.tlaplus
// ^^^^^^^^ comment.line

====
// <---- comment.line

0 comments on commit 0a6e2d8

Please sign in to comment.