diff options
-rw-r--r-- | parsing/parse.sh | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/parsing/parse.sh b/parsing/parse.sh index 577b41e..4d89806 100644 --- a/parsing/parse.sh +++ b/parsing/parse.sh @@ -240,13 +240,21 @@ else_part() while_clause() { - : TODO: Implement + if accept T_WHILE; then + if compound_list && do_group; then + return 0 + fi + fi return 1 } until_clause() { - : TODO: Implement + if accept T_UNTIL; then + if compound_list && do_group; then + return 0 + fi + fi return 1 } @@ -463,6 +471,8 @@ try() #try '{ foo; }' #try '( foo )' #try 'for i in 1 2 3; do stuff; done' -try 'if foo; then bar; fi' -try 'if foo; then bar; elif baz; then qux; else quux; fi' -try 'if ; then ; fi' +#try 'if foo; then bar; fi' +#try 'if foo; then bar; elif baz; then qux; else quux; fi' +#try 'if ; then ; fi' +try 'while foo; do bar; done' +try 'while ; do ; done' |