diff options
Diffstat (limited to 'src/shell.pest')
-rw-r--r-- | src/shell.pest | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/src/shell.pest b/src/shell.pest index f1f39ab..49a84b4 100644 --- a/src/shell.pest +++ b/src/shell.pest @@ -1,17 +1,11 @@ -char = { ASCII_ALPHANUMERIC } - +char = @{ !("|" | ";" | WHITESPACE) ~ ANY } word = @{ char+ } -exe = { word+ } - -and = { "&&" ~ command } -or = { "||" ~ command } -both = { ";" ~ command } -pipe = { "|" ~ command } - -command = { exe ~ (and | or | both | pipe)? } +exe = { word+ } +pipeline = { exe ~ ("|" ~ exe)* } +commands = { pipeline ~ (";" ~ pipeline)* } -line = { SOI ~ command ~ EOI } +line = { SOI ~ commands ~ EOI } -WHITESPACE = _{ " " } +WHITESPACE = _{ (" " | "\t" | "\n") } COMMENT = _{ "#" ~ ANY* } |