mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-21 02:03:03 +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:
@@ -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>
|
2008-11-21 Di-an Jan <dianj@freeshell.org>
|
||||||
|
|
||||||
Implement no-XXX arguments for --warnings, --report, --trace.
|
Implement no-XXX arguments for --warnings, --report, --trace.
|
||||||
|
|||||||
@@ -221,6 +221,29 @@ m4_define([b4_subtract],
|
|||||||
[m4_eval([$1 - $2])],
|
[m4_eval([$1 - $2])],
|
||||||
[($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. ##
|
## Decoding options. ##
|
||||||
|
|||||||
@@ -18,27 +18,6 @@
|
|||||||
|
|
||||||
m4_include(b4_pkgdatadir/[c++.m4])
|
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)
|
# b4_table_define(TABLE-NAME, CONTENT)
|
||||||
# ------------------------------------
|
# ------------------------------------
|
||||||
|
|||||||
Reference in New Issue
Block a user