]> git.saurik.com Git - bison.git/commitdiff
b4_args is more general than only C++.
authorAkim Demaille <demaille@gostai.com>
Fri, 21 Nov 2008 20:41:47 +0000 (21:41 +0100)
committerAkim Demaille <demaille@gostai.com>
Tue, 25 Nov 2008 21:07:23 +0000 (22:07 +0100)
* data/lalr1.cc (b4_args, _b4_args): Move to...
* data/bison.m4: here.

ChangeLog
data/bison.m4
data/lalr1.cc

index 7b3358caa55e8991e0573e6f6ae25e526014477c..31560f1b7a4e8347828e054cc36d95eb0d827726 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2008-11-25  Akim Demaille  <demaille@gostai.com>
+
+       b4_args is more general than only C++.
+       * data/lalr1.cc (b4_args, _b4_args): Move to...
+       * data/bison.m4: here.
+
 2008-11-21  Di-an Jan  <dianj@freeshell.org>
 
        Implement no-XXX arguments for --warnings, --report, --trace.
index c7392b3891beef03a10aed804d718479f149126a..e7376c6c04fd6723a640f6ace5d38407056f036b 100644 (file)
@@ -221,6 +221,29 @@ m4_define([b4_subtract],
            [m4_eval([$1 - $2])],
            [($1) - ($2)])])
 
+# b4_args(ARG1, ...)
+# _b4_args(ARG1, ...)
+# -------------------
+# Join with comma, skipping empty arguments.
+# b4_args calls itself recursively until it sees the first non-empty
+# argument, then calls _b4_args which prepends each non-empty argument
+# with a comma.
+m4_define([b4_args],
+[m4_if([$#$1],
+       [1], [],
+       [m4_ifval([$1],
+                 [$1[]_$0(m4_shift($@))],
+                 [$0(m4_shift($@))])])])
+
+# _b4_args(ARGS1, ...)
+# --------------------
+m4_define([_b4_args],
+[m4_if([$#$1],
+       [1], [],
+       [m4_ifval([$1], [, $1])[]$0(m4_shift($@))])])
+
+
+
 
 ## ------------------ ##
 ## Decoding options.  ##
index 58ebe94c4e278d8f9e9fcae9993b8add37fcbf76..404309054b3732fcde5d6e0ef46fdf930e428c16 100644 (file)
 
 m4_include(b4_pkgdatadir/[c++.m4])
 
-# b4_args(ARG1, ...)
-# _b4_args(ARG1, ...)
-# -------------------
-# Join with comma, skipping empty arguments.
-# b4_args calls itself recursively until it sees the first non-empty
-# argument, then calls _b4_args which prepends each non-empty argument
-# with a comma.
-m4_define([b4_args],
-[m4_if([$#$1],
-       [1], [],
-       [m4_ifval([$1],
-                 [$1[]_$0(m4_shift($@))],
-                 [$0(m4_shift($@))])])])
-
-# _b4_args(ARGS1, ...)
-# --------------------
-m4_define([_b4_args],
-[m4_if([$#$1],
-       [1], [],
-       [m4_ifval([$1], [, $1])[]$0(m4_shift($@))])])
-
 
 # b4_table_define(TABLE-NAME, CONTENT)
 # ------------------------------------