summaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
authorAkim Demaille <akim.demaille@gmail.com>2020-05-23 14:58:12 +0200
committerAkim Demaille <akim.demaille@gmail.com>2020-05-23 14:59:18 +0200
commit4e1a5aae96c9e7285c28c89e0145a7b538ffc71b (patch)
tree0ae470bfc390214e9bca9b66d6a11629554953b7 /data
parent8e70880af1c606e600667add063dab31696b4b46 (diff)
downloadbison-4e1a5aae96c9e7285c28c89e0145a7b538ffc71b.tar.gz
m4: use m4_shift2 etc.
* data/skeletons/bison.m4 (m4_shift4): New. Use them where applicable.
Diffstat (limited to 'data')
-rw-r--r--data/skeletons/bison.m46
1 files changed, 4 insertions, 2 deletions
diff --git a/data/skeletons/bison.m4 b/data/skeletons/bison.m4
index 8618c3f8..1130b6d5 100644
--- a/data/skeletons/bison.m4
+++ b/data/skeletons/bison.m4
@@ -38,6 +38,8 @@ m4_define([b4_gsub],
[$4], [$5]),
[$6], [$7])])
+# m4_shift2 and m4_shift3 are provided by m4sugar.
+m4_define([m4_shift4], [m4_shift(m4_shift(m4_shift(m4_shift($@))))])
## ---------------- ##
@@ -183,7 +185,7 @@ m4_define([b4_error],
[b4_cat([[@complain][(]$1[@,]$2[@,]$3[@,]$4[]]dnl
[m4_if([$#], [4], [],
[m4_foreach([b4_arg],
- m4_dquote(m4_shift(m4_shift(m4_shift(m4_shift($@))))),
+ m4_dquote(m4_shift4($@)),
[[@,]b4_arg])])[@)]])])
# b4_warn(FORMAT, [ARG1], [ARG2], ...)
@@ -748,7 +750,7 @@ m4_define([b4_check_user_names],
[m4_pushdef([b4_occurrence], b4_occurrence)dnl
m4_pushdef([b4_user_name], m4_car(b4_occurrence))dnl
m4_pushdef([b4_start], m4_car(m4_shift(b4_occurrence)))dnl
-m4_pushdef([b4_end], m4_shift(m4_shift(b4_occurrence)))dnl
+m4_pushdef([b4_end], m4_shift2(b4_occurrence))dnl
m4_ifndef($3[(]m4_quote(b4_user_name)[)],
[b4_complain_at([b4_start], [b4_end],
[[%s '%s' is not used]],