Skip to content

Fix shell parser to handle arrays and looping more like bash #4

Description

@GoogleCodeExporter
To do for-loops, SWAMP currently adheres to a misinterpretation of shell
specifications. 

Therefore, in the following loops,
a=(1 2 3)
for i in $a; do
echo $i
done

b=`seq 3`
for i in $b; do
echo $i
done

... both produce the same output.  In bash/sh, the range is supposed to be
a whitespace-delimited set, instead of an array.  In bash, if you provide
an array to the for-loop, it will treat the first element as the entire
range, meaning that the loop will only iterate multiple times if the first
element is itself a whitespace-delimited range.

SWAMP works this way because of the specification was initially
misinterpreted.  It needs to be fixed.

Original issue reported on code.google.com by daniel2...@gmail.com on 3 May 2008 at 12:33

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions