Add while expressions

This commit is contained in:
Bruno BELANYI 2022-06-01 20:19:56 +02:00
parent 19c1f11414
commit 26999482a3
5 changed files with 1825 additions and 1306 deletions

View file

@ -49,6 +49,7 @@ module.exports = grammar({
$.assignment_expression,
$.if_expression,
$.while_expression,
),
nil_literal: (_) => "nil",
@ -184,6 +185,13 @@ module.exports = grammar({
),
),
),
while_expression: ($) => seq(
"while",
field("condition", $._expr),
"do",
field("body", $._expr),
),
}
});