hush: fix "if { echo foo; } then { echo bar; } fi" parsing

function                                             old     new   delta
done_word                                            728     793     +65
parse_stream                                        2084    2098     +14
This commit is contained in:
Denis Vlasenko
2009-04-16 10:59:40 +00:00
parent 74a931ac9e
commit bb929517a8
4 changed files with 48 additions and 18 deletions

View File

@@ -0,0 +1,11 @@
Semicolons after } can be omitted 1:
foo
bar
Semicolons after } can be omitted 2:
foo
bar
Semicolons after fi can be omitted:
foo
bar
baz
Done:0

View File

@@ -0,0 +1,10 @@
echo "Semicolons after } can be omitted 1:"
if { echo foo; } then { echo bar; } fi
echo "Semicolons after } can be omitted 2:"
while { echo foo; } do { echo bar; break; } done
echo "Semicolons after fi can be omitted:"
while if echo foo; then echo bar; fi do echo baz; break; done
echo Done:$?

View File

@@ -1,5 +1,5 @@
if test $# = 0; then
#BUG in builtin_exec! will glob param!
# UNFIXED BUG in builtin_exec! will glob param!
#exec "$THIS_SH" "$0" 'param_glob.t*'
"$THIS_SH" "$0" 'param_glob.t*'
exit