mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-19 01:03:04 +00:00
* data/m4sugar/m4sugar.m4 (_m4_map): New macro.
(m4_map, m4_map_sep): Use it. Handle the empty list correctly.
This commit is contained in:
@@ -1,3 +1,8 @@
|
|||||||
|
2005-10-05 Paul Eggert <eggert@cs.ucla.edu>
|
||||||
|
|
||||||
|
* data/m4sugar/m4sugar.m4 (_m4_map): New macro.
|
||||||
|
(m4_map, m4_map_sep): Use it. Handle the empty list correctly.
|
||||||
|
|
||||||
2005-10-04 Paul Eggert <eggert@cs.ucla.edu>
|
2005-10-04 Paul Eggert <eggert@cs.ucla.edu>
|
||||||
|
|
||||||
Undo the parts of the unlocked-I/O change that substituted
|
Undo the parts of the unlocked-I/O change that substituted
|
||||||
|
|||||||
@@ -398,8 +398,11 @@ m4_define([m4_cdr],
|
|||||||
# of LIST (which can be lists themselves, for multiple arguments MACROs).
|
# of LIST (which can be lists themselves, for multiple arguments MACROs).
|
||||||
m4_define([m4_fst], [$1])
|
m4_define([m4_fst], [$1])
|
||||||
m4_define([m4_map],
|
m4_define([m4_map],
|
||||||
|
[m4_if([$2], [[]], [],
|
||||||
|
[_m4_map([$1], [$2])])])
|
||||||
|
m4_define([_m4_map],
|
||||||
[m4_ifval([$2],
|
[m4_ifval([$2],
|
||||||
[$1(m4_fst($2))[]m4_map([$1], m4_cdr($2))])])
|
[$1(m4_fst($2))[]_m4_map([$1], m4_cdr($2))])])
|
||||||
|
|
||||||
|
|
||||||
# m4_map_sep(MACRO, SEPARATOR, LIST)
|
# m4_map_sep(MACRO, SEPARATOR, LIST)
|
||||||
@@ -408,8 +411,8 @@ m4_define([m4_map],
|
|||||||
# are the elements of LIST (which can be lists themselves, for multiple
|
# are the elements of LIST (which can be lists themselves, for multiple
|
||||||
# arguments MACROs).
|
# arguments MACROs).
|
||||||
m4_define([m4_map_sep],
|
m4_define([m4_map_sep],
|
||||||
[m4_ifval([$3],
|
[m4_if([$3], [[]], [],
|
||||||
[$1(m4_fst($3))[]m4_map([$2[]$1], m4_cdr($3))])])
|
[$1(m4_fst($3))[]_m4_map([$2[]$1], m4_cdr($3))])])
|
||||||
|
|
||||||
|
|
||||||
## ---------------------------------------- ##
|
## ---------------------------------------- ##
|
||||||
|
|||||||
Reference in New Issue
Block a user