aboutsummaryrefslogtreecommitdiffstats
path: root/awkgram.y
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2020-06-05 13:30:24 +0300
committerArnold D. Robbins <arnold@skeeve.com>2020-06-05 13:30:24 +0300
commit442540d32d7fd7f0880db8640d285b3e90c20e3d (patch)
tree28a14e3aa52b2109a40eaced82002d4f28a8f862 /awkgram.y
parent47dce6a7002a8d7b818c19d574d81327b769871b (diff)
downloadegawk-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.y8
1 files changed, 7 insertions, 1 deletions
diff --git a/awkgram.y b/awkgram.y
index 281d0ef8..c427a5b7 100644
--- a/awkgram.y
+++ b/awkgram.y
@@ -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