Add array expression

This commit is contained in:
Bruno BELANYI 2022-06-01 19:48:54 +02:00
parent 02f83784b1
commit babf666642
5 changed files with 883 additions and 500 deletions

View file

@ -30,6 +30,8 @@ module.exports = grammar({
$.integer_literal,
$.string_literal,
$.array_expression,
$.unary_expression,
$.binary_expression,
$.sequence_expression,
@ -95,6 +97,15 @@ module.exports = grammar({
},
sequence_expression: ($) => seq("(", sepBy(";", $._expr), ")"),
array_expression: ($) => seq(
field("type", $.identifier),
"[",
field("size", $._expr),
"]",
"of",
field("init", $._expr),
),
}
});