summaryrefslogtreecommitdiffstats
path: root/src/shell.pest
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2022-01-08 19:02:28 -0500
committerJesse Luehrs <doy@tozt.net>2022-01-08 19:02:28 -0500
commit96b45b2d3dd1ff0ee9312150f2a642058df7668b (patch)
treeea7689b74153853cad7ed169fceabef07a979274 /src/shell.pest
parent21f67c732a4af18b3a42b9fd34f4b1f4ec7a258d (diff)
downloadnbsh-96b45b2d3dd1ff0ee9312150f2a642058df7668b.tar.gz
nbsh-96b45b2d3dd1ff0ee9312150f2a642058df7668b.zip
fix for loop parsing
Diffstat (limited to 'src/shell.pest')
-rw-r--r--src/shell.pest3
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 }