Stage 8: extend life of references into argv.
commitc947bf47f48f9132155bc623596771e4a4e3f732
authorEric Blake <ebb9@byu.net>
Fri, 26 Oct 2007 04:05:15 +0000 (25 22:05 -0600)
committerEric Blake <ebb9@byu.net>
Tue, 18 Dec 2007 14:09:44 +0000 (18 07:09 -0700)
tree544dedefe24da15d931b34d10373beac2b9d6fcf
parentda38cc2a2e8272f41366ed87aee5abe64e81c3f9
Stage 8: extend life of references into argv.

* src/m4.h (obstack_regrow): Delete, now that it is unused.
(struct token_chain): Add level field.
(push_token): Adjust prototype.
(adjust_refcount): New prototype.
* src/macro.c [DEBUG_MACRO]: Add debugging hooks for $@ reference
counting.
(argc_stack, argv_stack): Delete, replaced by...
(struct macro_arg_stacks, stacks, stacks_count): ...these new
structure for tracking $@ references.
(expand_input): Initialize new structure.
(collect_arguments): Alter signature.
(expand_macro): Rework obstack handling, in order to keep $@
references alive until they have been rescanned.
(adjust_refcount, arg_mark): New functions.
(make_argv_ref): Use new field.
(push_arg, push_args): Update callers.
* src/input.c (make_text_link): Use new field.
(push_token): Change signature.
(pop_input, next_char_1): Call new function.
* doc/m4.texinfo: Clean up some examples of -d option usage.
(Ifelse): Add some stress tests.

(cherry picked from commit b0daa4c96f734aab4d450594f64bc15d4321fd60)

Signed-off-by: Eric Blake <ebb9@byu.net>
ChangeLog
doc/m4.texinfo
src/input.c
src/m4.h
src/macro.c