Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes to parsing of use, else & commands #90

Merged
merged 16 commits into from
May 24, 2024
Prev Previous commit
Next Next commit
Fix parsing of command
Allow for the alternative syntax to write commands: ^'command_name'.
  • Loading branch information
CabalCrow committed May 23, 2024
commit 9277d2f5410417bdb4b7d2fb74ce0ddb2d6224f5
10 changes: 8 additions & 2 deletions grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -1188,14 +1188,20 @@ module.exports = grammar({

command: ($) =>
seq(
field("head", seq(optional(PUNC().caret), $.cmd_identifier)),
choice(
field("head", seq(optional(PUNC().caret), $.cmd_identifier)),
field("head", seq(PUNC().caret, $.val_string)),
),
prec.dynamic(10, repeat($._cmd_arg)),
),

_command_parenthesized_body: ($) =>
prec.right(
seq(
field("head", seq(optional(PUNC().caret), $.cmd_identifier)),
choice(
field("head", seq(optional(PUNC().caret), $.cmd_identifier)),
field("head", seq(PUNC().caret, $.val_string)),
),
prec.dynamic(10, repeat(seq(optional("\n"), $._cmd_arg))),
optional("\n"),
),
Expand Down