Add 'operator' aliases
This commit is contained in:
parent
25924c3c5c
commit
3e46a9b762
7 changed files with 121 additions and 68 deletions
|
|
@ -28,7 +28,7 @@ module.exports = grammar({
|
|||
|
||||
assignment: ($) => seq(
|
||||
field("left", $.identifier),
|
||||
field("operator", choice("=", "+=")),
|
||||
field("operator", alias(choice("=", "+="), $.operator)),
|
||||
field("right", $._expr),
|
||||
),
|
||||
|
||||
|
|
@ -189,7 +189,7 @@ module.exports = grammar({
|
|||
|
||||
binary_expression: ($) => prec.left(seq(
|
||||
field("left", $._expr),
|
||||
field("operator", "+"),
|
||||
field("operator", alias("+", $.operator)),
|
||||
field("right", $._expr),
|
||||
)),
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue