Add function calls

This commit is contained in:
Bruno BELANYI 2022-06-01 19:58:40 +02:00
parent 136924cb26
commit 8921953bbb
5 changed files with 1258 additions and 794 deletions

View file

@ -33,6 +33,8 @@ module.exports = grammar({
$.array_expression,
$.record_expression,
$.function_call,
$.unary_expression,
$.binary_expression,
$.sequence_expression,
@ -67,6 +69,13 @@ module.exports = grammar({
)
),
function_call: ($) => seq(
field("function", $.identifier),
"(",
field("arguments", sepBy(",", $._expr)),
")",
),
unary_expression: ($) => seq(
field("operator", alias("-", $.operator)),
field("expression", $._expr),