Skip to content

Commit

Permalink
Fix parsing for command
Browse files Browse the repository at this point in the history
Allow it to also parse this command syntax: ^()
  • Loading branch information
CabalCrow committed May 23, 2024
1 parent 44d8b3e commit 1c151b9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -1190,7 +1190,8 @@ module.exports = grammar({
seq(
choice(
field("head", seq(optional(PUNC().caret), $.cmd_identifier)),
field("head", seq(PUNC().caret, $.val_string)),
field("head", seq(PUNC().caret, $.val_string)), // Support for ^'command' type of syntax.
field("head", seq(PUNC().caret, $.expr_parenthesized)), // Support for pipes into external command.
),
prec.dynamic(10, repeat($._cmd_arg)),
),
Expand All @@ -1200,7 +1201,8 @@ module.exports = grammar({
seq(
choice(
field("head", seq(optional(PUNC().caret), $.cmd_identifier)),
field("head", seq(PUNC().caret, $.val_string)),
field("head", seq(PUNC().caret, $.val_string)), // Support for ^'command' type of syntax.
field("head", seq(PUNC().caret, $.expr_parenthesized)), // Support for pipes into external command.
),
prec.dynamic(10, repeat(seq(optional("\n"), $._cmd_arg))),
optional("\n"),
Expand Down

0 comments on commit 1c151b9

Please sign in to comment.