Rewrite handling of diversion and expansion stack.
commit250422b094f3a4f3a49ecb78715de5adaa2eae6c
authorPaolo Bonzini <bonzini@gnu.org>
Tue, 28 Oct 2008 11:18:55 +0000 (28 12:18 +0100)
committerPaolo Bonzini <bonzini@gnu.org>
Wed, 29 Oct 2008 07:00:08 +0000 (29 08:00 +0100)
treeb5b78ba652e19ae05a45f72176e7901dbbe061d9
parent63ec266226a0ceb591bd84bc1cef152cdb20a513
Rewrite handling of diversion and expansion stack.

* NEWS: Document stricter requirement on m4_init.
* lib/m4sugar/m4sugar.m4 (m4_divert_stack): New, replacing
_m4_divert_n_stack.
(_m4_divert_stack_push): New.
(m4_divert): Use _m4_divert_stack_push and replace m4_define with
m4_popdef.
(m4_divert_push): Use _m4_divert_stack_push.
(m4_divert_pop): Use m4_divert_stack instead of _m4_divert_n_stack,
pop _m4_divert_stack instead of m4_divert_stack.
(m4_expansion_stack): New.  Update comment above it.
(m4_expansion_stack_push, m4_expansion_stack_pop): Work on
_m4_expansion_stack instead of m4_expansion_stack.
(m4_expansion_stack_dump): Check presence of _m4_expansion_stack
instead of m4_expansion_stack.  Use m4_expansion_stack's expansion
instead of the definition, and compensate for the trailing newline
in the expansion.
(m4_warn, _m4_defun_pro, _m4_defun_epi): Check presence of
_m4_expansion_stack instead of m4_expansion_stack.
(m4_newline): Expand first argument after the newline.
(m4_init): Use m4_divert_stack instead of _m4_divert_n_stack,
* tests/m4sugar.at (m4_append, m4_text_wrap): Invoke m4_init.
* tests/tools.at (whitespace in file names, the empty token): Likewise.
ChangeLog
NEWS
lib/m4sugar/m4sugar.m4
tests/m4sugar.at
tests/tools.at