m4: use m4_shift2 etc.

* data/skeletons/bison.m4 (m4_shift4): New.
Use them where applicable.
This commit is contained in:
Akim Demaille
2020-05-23 14:58:12 +02:00
parent 8e70880af1
commit 4e1a5aae96

View File

@@ -38,6 +38,8 @@ m4_define([b4_gsub],
[$4], [$5]), [$4], [$5]),
[$6], [$7])]) [$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 [b4_cat([[@complain][(]$1[@,]$2[@,]$3[@,]$4[]]dnl
[m4_if([$#], [4], [], [m4_if([$#], [4], [],
[m4_foreach([b4_arg], [m4_foreach([b4_arg],
m4_dquote(m4_shift(m4_shift(m4_shift(m4_shift($@))))), m4_dquote(m4_shift4($@)),
[[@,]b4_arg])])[@)]])]) [[@,]b4_arg])])[@)]])])
# b4_warn(FORMAT, [ARG1], [ARG2], ...) # 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_occurrence], b4_occurrence)dnl
m4_pushdef([b4_user_name], m4_car(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_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)[)], m4_ifndef($3[(]m4_quote(b4_user_name)[)],
[b4_complain_at([b4_start], [b4_end], [b4_complain_at([b4_start], [b4_end],
[[%s '%s' is not used]], [[%s '%s' is not used]],