mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 12:23:04 +00:00
b4_args is more general than only C++.
* data/lalr1.cc (b4_args, _b4_args): Move to... * data/bison.m4: here.
This commit is contained in:
@@ -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. ##
|
||||
|
||||
Reference in New Issue
Block a user