From 33973500489c7d918a33dccb399491726bde65a2 Mon Sep 17 00:00:00 2001 From: Kamil Jakubus Date: Fri, 27 Sep 2024 11:37:09 +0200 Subject: [PATCH] parser: slightly more implemented on_statement Fixes #83 --- grammar.js | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/grammar.js b/grammar.js index 6950b86..ba66296 100644 --- a/grammar.js +++ b/grammar.js @@ -1236,13 +1236,25 @@ module.exports = grammar({ widget_phrase: ($) => prec.left(seq(kw("FRAME"), $.identifier, repeat($.widget_field))), - on_statement: ($) => + of_phrase: ($) => seq( - kw("ON"), - seq($._expression, repeat(seq(",", $._expression))), - optional(kw("ANYWHERE")), kw("OF"), seq($._expression, repeat(seq(",", $._expression))), + optional( + seq( + kw("NEW"), + seq($._expression, repeat(seq(",", $._expression))), + kw("OLD"), + seq($._expression, repeat(seq(",", $._expression))) + ) + ), + optional(kw("ANYWHERE")) + ), + on_statement: ($) => + seq( + kw("ON"), + _list($._expression, ","), + choice(kw("ANYWHERE"), $.of_phrase), optional(kw("IN")), repeat($.widget_phrase), $.do_block