From 96b45b2d3dd1ff0ee9312150f2a642058df7668b Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Sat, 8 Jan 2022 19:02:28 -0500 Subject: fix for loop parsing --- src/shell.pest | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/shell.pest') 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 } -- cgit v1.2.3-54-g00ecf