diff options
author | Jesse Luehrs <doy@tozt.net> | 2022-01-08 19:02:28 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2022-01-08 19:02:28 -0500 |
commit | 96b45b2d3dd1ff0ee9312150f2a642058df7668b (patch) | |
tree | ea7689b74153853cad7ed169fceabef07a979274 /src/shell.pest | |
parent | 21f67c732a4af18b3a42b9fd34f4b1f4ec7a258d (diff) | |
download | nbsh-96b45b2d3dd1ff0ee9312150f2a642058df7668b.tar.gz nbsh-96b45b2d3dd1ff0ee9312150f2a642058df7668b.zip |
fix for loop parsing
Diffstat (limited to 'src/shell.pest')
-rw-r--r-- | src/shell.pest | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/shell.pest b/src/shell.pest index 8c0e79c..4c5f728 100644 --- a/src/shell.pest +++ b/src/shell.pest @@ -27,11 +27,12 @@ word = ${ } exe = ${ word ~ (w ~ word)* } +list = ${ word ~ (w ~ word)* } pipeline = ${ exe ~ (w? ~ "|" ~ w? ~ exe)* } control_if = ${ "if" ~ w ~ pipeline } control_while = ${ "while" ~ w ~ pipeline } -control_for = ${ "for" ~ w ~ bareword ~ w ~ "in" ~ w ~ pipeline } +control_for = ${ "for" ~ w ~ bareword ~ w ~ "in" ~ w ~ list } control_end = ${ "end" } control = ${ control_if | control_while | control_for | control_end } |