Skip to content

Commit

Permalink
parser: slightly more implemented on_statement
Browse files Browse the repository at this point in the history
Fixes #83
  • Loading branch information
jkbz64 committed Sep 27, 2024
1 parent 24c34a6 commit 3397350
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3397350

Please sign in to comment.