bison-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 2/6] m4: use m4_shift2 etc.


From: Akim Demaille
Subject: [PATCH 2/6] m4: use m4_shift2 etc.
Date: Sat, 23 May 2020 17:14:41 +0200

* data/skeletons/bison.m4 (m4_shift4): New.
Use them where applicable.
---
 data/skeletons/bison.m4 | 6 ++++--
 1 file 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]],
-- 
2.26.2




reply via email to

[Prev in Thread] Current Thread [Next in Thread]