diff options
author | Jesse Luehrs <doy@tozt.net> | 2022-01-07 04:24:58 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2022-01-07 04:24:58 -0500 |
commit | de5db374da5c53e44c52bf896140efaf4b7ae7ec (patch) | |
tree | b59eb8269a4ad2b56ad5aef937dbfdb840ffda79 | |
parent | 3db9053455a1fcc6f95a8f65a819462792a717bf (diff) | |
download | nbsh-de5db374da5c53e44c52bf896140efaf4b7ae7ec.tar.gz nbsh-de5db374da5c53e44c52bf896140efaf4b7ae7ec.zip |
fix append redirection parsing
-rw-r--r-- | src/parse.rs | 7 | ||||
-rw-r--r-- | src/shell.pest | 2 |
2 files changed, 8 insertions, 1 deletions
diff --git a/src/parse.rs b/src/parse.rs index 5193769..229f387 100644 --- a/src/parse.rs +++ b/src/parse.rs @@ -518,5 +518,12 @@ mod test { p!("foo >>bar", e!(w!("foo") ; r!(1, "bar", Append))) ) ); + parse_eq!( + "foo >> bar", + c!( + "foo >> bar", + p!("foo >> bar", e!(w!("foo") ; r!(1, "bar", Append))) + ) + ); } } diff --git a/src/shell.pest b/src/shell.pest index 408a996..1ff20c4 100644 --- a/src/shell.pest +++ b/src/shell.pest @@ -2,7 +2,7 @@ bareword_char = @{ !("|" | ";" | "\"" | "'" | WHITESPACE | COMMENT) ~ ANY } single_string_char = @{ "\\'" | (!"'" ~ ANY) } double_string_char = @{ "\\\"" | (!"\"" ~ ANY) } -redir_prefix = @{ (ASCII_DIGIT* ~ (">" | "<" | ">>") ~ WHITESPACE*) } +redir_prefix = @{ ASCII_DIGIT* ~ (">>" | ">" | "<") ~ WHITESPACE* } bareword = @{ bareword_char+ } single_string = @{ single_string_char+ } double_string = @{ double_string_char+ } |