diff options
author | Jesse Luehrs <doy@tozt.net> | 2022-01-18 01:40:43 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2022-01-18 01:40:43 -0500 |
commit | 4b76cb2100fdefecff79e2999b2a648eb149018b (patch) | |
tree | f6b06d49d2751a731ef27967815cc65b4aa066fc /src/shell.pest | |
parent | d53e7af40835b06a391bd8780edaa0160eec2411 (diff) | |
download | nbsh-4b76cb2100fdefecff79e2999b2a648eb149018b.tar.gz nbsh-4b76cb2100fdefecff79e2999b2a648eb149018b.zip |
support redirects with subshells
Diffstat (limited to 'src/shell.pest')
-rw-r--r-- | src/shell.pest | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/shell.pest b/src/shell.pest index d2c96b8..0c63802 100644 --- a/src/shell.pest +++ b/src/shell.pest @@ -47,7 +47,9 @@ redir_prefix = @{ redirect = ${ redir_prefix ~ w? ~ word } exe = ${ (redirect | word) ~ (w ~ (redirect | word))* } -subshell = ${ "(" ~ w? ~ commands ~ w? ~ ")" } +subshell = ${ + "(" ~ w? ~ commands ~ w? ~ ")" ~ (w? ~ redirect ~ (w ~ redirect)*)? +} list = ${ word ~ (w ~ word)* } pipeline = ${ (subshell | exe) ~ (w? ~ "|" ~ w? ~ (subshell | exe))* } |