aboutsummaryrefslogtreecommitdiffstats
path: root/awkgram.y
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2022-04-14 07:00:15 -0700
committerKaz Kylheku <kaz@kylheku.com>2022-04-14 07:00:15 -0700
commitf00e74ffc73f6ba6fe74fb7a26319770b8c3792c (patch)
tree931278a791b5ed7bacd47ce35c7ed224a9e0ccce /awkgram.y
parentd3064bd9a5116f57e60f3da91ffcf3f1a58b9ab0 (diff)
downloadegawk-master.tar.gz
egawk-master.tar.bz2
egawk-master.zip
@let: allow trailing comma.HEADmaster
We allow forms like @let(x,) and @let(x, y=1,) with the trailing comma. This is helpful for code generators and macros, which can then treat temporary variables as comma-terminated items. * awkgram.y (let_var_list_opt): Add a production which matches a trailing comma after let_var_list. * test/let1.awk, test/let1.ok: Test cases. * doc/gawkt.texi, doc/gawktexi.in: Trailing comma documented. * awkgram.c: Regenerated with Bison 3.8.
Diffstat (limited to 'awkgram.y')
-rw-r--r--awkgram.y2
1 files changed, 2 insertions, 0 deletions
diff --git a/awkgram.y b/awkgram.y
index 4f568e22..fc35100d 100644
--- a/awkgram.y
+++ b/awkgram.y
@@ -1603,6 +1603,8 @@ let_var_list_opt
{ $$ = NULL; }
| let_var_list
{ $$ = $1; }
+ | let_var_list comma
+ { $$ = $1; }
;
let_var_list