aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bashast/bashast.g2
-rw-r--r--bashast/gunit/compound.gunit1
2 files changed, 2 insertions, 1 deletions
diff --git a/bashast/bashast.g b/bashast/bashast.g
index b380379..6204ed0 100644
--- a/bashast/bashast.g
+++ b/bashast/bashast.g
@@ -446,7 +446,7 @@ for_expr
(
name wspace
(
- IN for_each_value* (SEMIC|EOL) wspace?
+ IN for_each_value* BLANK? (SEMIC|EOL) wspace?
|SEMIC wspace?
|
) DO wspace command_list semiel DONE -> ^(FOR name for_each_value* command_list)
diff --git a/bashast/gunit/compound.gunit b/bashast/gunit/compound.gunit
index 18314bf..7270246 100644
--- a/bashast/gunit/compound.gunit
+++ b/bashast/gunit/compound.gunit
@@ -94,6 +94,7 @@ done" -> (for each (STRING (COMMAND_SUB `ls |grep log`)) (LIST (COMMAND (STRING
"for each in `ls |grep log`;do echo \"file found\"; done" -> (for each (STRING (COMMAND_SUB `ls |grep log`)) (LIST (COMMAND (STRING echo) (STRING (DOUBLE_QUOTED_STRING file found)))))
"for i in 'foo' 'bar'; do echo $i; done" -> (for i (STRING (SINGLE_QUOTED_STRING 'foo')) (STRING (SINGLE_QUOTED_STRING 'bar')) (LIST (COMMAND (STRING echo) (STRING (VAR_REF i)))))
"for i in foo$var bar; do echo $i; done" -> (for i (STRING foo (VAR_REF var)) (STRING bar) (LIST (COMMAND (STRING echo) (STRING (VAR_REF i)))))
+"for i in foo$var bar ; do echo $i; done" -> (for i (STRING foo (VAR_REF var)) (STRING bar) (LIST (COMMAND (STRING echo) (STRING (VAR_REF i)))))
"for each in `ls |grep log`; do echo file done" FAIL
"for ((5+3;5+3;5+3)); do echo yay; done" -> (CFOR (FOR_INIT (+ 5 3)) (FOR_COND (+ 5 3)) (LIST (COMMAND (STRING echo) (STRING yay))) (FOR_MOD (+ 5 3)))