diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2020-06-05 13:30:24 +0300 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2020-06-05 13:30:24 +0300 |
commit | 442540d32d7fd7f0880db8640d285b3e90c20e3d (patch) | |
tree | 28a14e3aa52b2109a40eaced82002d4f28a8f862 /awkgram.y | |
parent | 47dce6a7002a8d7b818c19d574d81327b769871b (diff) | |
download | egawk-442540d32d7fd7f0880db8640d285b3e90c20e3d.tar.gz egawk-442540d32d7fd7f0880db8640d285b3e90c20e3d.tar.bz2 egawk-442540d32d7fd7f0880db8640d285b3e90c20e3d.zip |
Allow typed regex in return statement. Update the doc.
Diffstat (limited to 'awkgram.y')
-rw-r--r-- | awkgram.y | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -1094,7 +1094,7 @@ non_compound_stmt { if (! in_function) yyerror(_("`return' used outside function context")); - } opt_exp statement_term { + } opt_fcall_exp statement_term { if (called_from_eval) $1->opcode = Op_K_return_from_eval; @@ -1614,6 +1614,12 @@ fcall_exp | typed_regexp { $$ = list_create($1); } ; +opt_fcall_exp + : /* empty */ + { $$ = NULL; } + | fcall_exp { $$ = $1; } + ; + /* Expressions, not including the comma operator. */ exp : variable assign_operator exp %prec ASSIGNOP |