mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-19 17:23:02 +00:00
* data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
This commit is contained in:
@@ -1,3 +1,7 @@
|
|||||||
|
2002-05-03 Akim Demaille <akim@epita.fr>
|
||||||
|
|
||||||
|
* data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
|
||||||
|
|
||||||
2002-05-02 Robert Anisko <robert@lrde.epita.fr>
|
2002-05-02 Robert Anisko <robert@lrde.epita.fr>
|
||||||
|
|
||||||
* data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
|
* data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
|
||||||
|
|||||||
@@ -422,8 +422,8 @@ m4_define([m4_bmatch],
|
|||||||
[m4_if([$#], 0, [],
|
[m4_if([$#], 0, [],
|
||||||
[$#], 1, [],
|
[$#], 1, [],
|
||||||
[$#], 2, [$2],
|
[$#], 2, [$2],
|
||||||
m4_bregexp([$1], [$2]), -1, [$0([$1], m4_shiftn(3, $@))],
|
[m4_if(m4_bregexp([$1], [$2]), -1, [$0([$1], m4_shiftn(3, $@))],
|
||||||
[$3])])
|
[$3])])])
|
||||||
|
|
||||||
|
|
||||||
# m4_map(MACRO, LIST)
|
# m4_map(MACRO, LIST)
|
||||||
@@ -437,6 +437,20 @@ m4_define([m4_map],
|
|||||||
m4_map([$1], m4_cdr($2))])])
|
m4_map([$1], m4_cdr($2))])])
|
||||||
|
|
||||||
|
|
||||||
|
# m4_map_sep(MACRO, SEPARATOR, LIST)
|
||||||
|
# ----------------------------------
|
||||||
|
# Invoke MACRO($1), SEPARATOR, MACRO($2), ..., MACRO($N) where $1, $2... $N
|
||||||
|
# are the elements of LIST (which can be lists themselves, for multiple
|
||||||
|
# arguments MACROs).
|
||||||
|
m4_define([m4_map_sep],
|
||||||
|
[m4_if([$3], [[]], [],
|
||||||
|
[$1(m4_fst($3))[]dnl
|
||||||
|
m4_if(m4_cdr($3),
|
||||||
|
[[]], [],
|
||||||
|
[$2])[]dnl
|
||||||
|
m4_map_sep([$1], [$2], m4_cdr($3))])])
|
||||||
|
|
||||||
|
|
||||||
## ---------------------------------------- ##
|
## ---------------------------------------- ##
|
||||||
## 6. Enhanced version of some primitives. ##
|
## 6. Enhanced version of some primitives. ##
|
||||||
## ---------------------------------------- ##
|
## ---------------------------------------- ##
|
||||||
@@ -469,7 +483,7 @@ m4_define([m4_bpatsubsts],
|
|||||||
# ------------------
|
# ------------------
|
||||||
# This macro invokes all its arguments (in sequence, of course). It is
|
# This macro invokes all its arguments (in sequence, of course). It is
|
||||||
# useful for making your macros more structured and readable by dropping
|
# useful for making your macros more structured and readable by dropping
|
||||||
# unecessary dnl's and have the macros indented properly.
|
# unnecessary dnl's and have the macros indented properly.
|
||||||
m4_define([m4_do],
|
m4_define([m4_do],
|
||||||
[m4_if($#, 0, [],
|
[m4_if($#, 0, [],
|
||||||
$#, 1, [$1],
|
$#, 1, [$1],
|
||||||
@@ -615,7 +629,7 @@ m4_if($1, [$2], [],
|
|||||||
# Implementing `foreach' loops in m4 is much more tricky than it may
|
# Implementing `foreach' loops in m4 is much more tricky than it may
|
||||||
# seem. Actually, the example of a `foreach' loop in the m4
|
# seem. Actually, the example of a `foreach' loop in the m4
|
||||||
# documentation is wrong: it does not quote the arguments properly,
|
# documentation is wrong: it does not quote the arguments properly,
|
||||||
# which leads to undesired expansions.
|
# which leads to undesirable expansions.
|
||||||
#
|
#
|
||||||
# The example in the documentation is:
|
# The example in the documentation is:
|
||||||
#
|
#
|
||||||
@@ -1484,7 +1498,7 @@ m4_define([m4_flatten],
|
|||||||
# of brackets around $1 (don't forget that the result must be quoted
|
# of brackets around $1 (don't forget that the result must be quoted
|
||||||
# too, hence one more quoting than applications).
|
# too, hence one more quoting than applications).
|
||||||
#
|
#
|
||||||
# Then notice the 2 last pattens: they are in charge of removing the
|
# Then notice the 2 last patterns: they are in charge of removing the
|
||||||
# leading/trailing spaces. Why not just `[^ ]'? Because they are
|
# leading/trailing spaces. Why not just `[^ ]'? Because they are
|
||||||
# applied to doubly quoted strings, i.e. more or less [[STRING]]. So
|
# applied to doubly quoted strings, i.e. more or less [[STRING]]. So
|
||||||
# if there is a leading space in STRING, then it is the *third*
|
# if there is a leading space in STRING, then it is the *third*
|
||||||
|
|||||||
Reference in New Issue
Block a user