Add binary expression

This commit is contained in:
Bruno BELANYI 2024-04-08 02:12:22 +01:00
parent 5489bd5380
commit 25924c3c5c
5 changed files with 1259 additions and 934 deletions

View file

@ -71,6 +71,8 @@ module.exports = grammar({
// Composites
$.list_expression,
$.map_expression,
// Operators
$.binary_expression,
),
// The Blueprint scanner makes use of Go's lexer, so copy their rule
@ -185,6 +187,12 @@ module.exports = grammar({
"}",
),
binary_expression: ($) => prec.left(seq(
field("left", $._expr),
field("operator", "+"),
field("right", $._expr),
)),
// }}}
// Properties {{{