Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed parsing issue on echo a~b
Browse files Browse the repository at this point in the history
prsabahrami committed Sep 8, 2024
1 parent c20d2e3 commit 8c28dd9
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions crates/deno_task_shell/src/grammar.pest
Original file line number Diff line number Diff line change
@@ -8,16 +8,24 @@ COMMENT = _{ "#" ~ (!NEWLINE ~ ANY)* }
QUOTED_WORD = { DOUBLE_QUOTED | SINGLE_QUOTED }

UNQUOTED_PENDING_WORD = ${
(TILDE_PREFIX ~ (!(OPERATOR | WHITESPACE | NEWLINE) ~ (
EXIT_STATUS |
UNQUOTED_ESCAPE_CHAR |
SUB_COMMAND |
("$" ~ "{" ~ VARIABLE ~ "}" | "$" ~ VARIABLE) |
UNQUOTED_CHAR |
QUOTED_WORD
))*)
|
(!(OPERATOR | WHITESPACE | NEWLINE) ~ (
EXIT_STATUS |
UNQUOTED_ESCAPE_CHAR |
SUB_COMMAND |
("$" ~ "{" ~ VARIABLE ~ "}" | "$" ~ VARIABLE) |
TILDE_PREFIX |
UNQUOTED_CHAR |
QUOTED_WORD
)
)+ }
))+
}

TILDE_PREFIX = ${
"~" ~ (!(OPERATOR | WHITESPACE | NEWLINE | "/") ~ (

0 comments on commit 8c28dd9

Please sign in to comment.