diff options
-rw-r--r-- | parsing/parse.sh | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/parsing/parse.sh b/parsing/parse.sh index 4d89806..93699f8 100644 --- a/parsing/parse.sh +++ b/parsing/parse.sh @@ -260,13 +260,22 @@ until_clause() function_defn() { - : TODO: Implement + if accept T_FNAME; then + if accept T_LPAREN; then + expect T_RPAREN + if linebreak && function_body; then + return 0 + fi + fi + fi return 1 } function_body() { - : TODO: Implement + if compound_command; then + redirect_list + fi return 1 } @@ -474,5 +483,6 @@ try() #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' +#try 'while foo; do bar; done' +#try 'while ; do ; done' +#try 'foo(){ bar; }' |