Add parentherized expression

main
Clément FRÉVILLE 2 years ago
parent 93886d67e2
commit e189485969
Signed by: clement.freville2
GPG Key ID: 732E73BB80FA6076

@ -8,6 +8,7 @@ module.exports = grammar({
$.line_comment, $.line_comment,
$.block_comment, $.block_comment,
], ],
word: $ => $.identifier,
rules: { rules: {
source_file: $ => optional($._declarations), source_file: $ => optional($._declarations),
@ -94,6 +95,7 @@ module.exports = grammar({
$.assignation, $.assignation,
$.infix_expression, $.infix_expression,
$.prefix_expression, $.prefix_expression,
$.parentherized_expression,
$.expansion, $.expansion,
$.primary $.primary
), ),
@ -140,6 +142,11 @@ module.exports = grammar({
choice('!', '-'), choice('!', '-'),
$._expression $._expression
)), )),
parentherized_expression: $ => seq(
'(',
$._expression,
')'
),
expansion: $ => choice( expansion: $ => choice(
$.variable, $.variable,

Loading…
Cancel
Save