Stage 5: add notion of quote age.
commit83e9a157eb78afe47c7955a6fa99e0de79a8b40a
authorEric Blake <ebb9@byu.net>
Wed, 24 Oct 2007 14:36:26 +0000 (24 08:36 -0600)
committerEric Blake <ebb9@byu.net>
Fri, 7 Dec 2007 14:07:36 +0000 (7 07:07 -0700)
treee1633088be4429641ad5fd53917a3117cba360df
parentea218b8834f1244a5fa897dae3770c7abdda419b
Stage 5: add notion of quote age.

* src/input.c: Comment cleanups.
(current_quote_age): New global variable.
(set_quote_age): New helper function.
(input_init, set_word_regexp): Use it.
(set_quotes, set_comment): Likewise, and detect no-op changes.
(quote_age, safe_quotes): New functions.
(next_token): Track quote age.
* src/m4.h (struct token_data): Add quote_age member.
(TOKEN_DATA_QUOTE_AGE, quote_age, safe_quotes): New prototypes.
* src/macro.c (struct macro_arguments): Add quote_age member.
(expand_token): Alter signature and track quote age.
(expand_input, expand_argument): All callers changed.
(collect_arguments, make_argv_ref): Track quote age.
(arg_text, arg_len, arg_func): Detect type mismatch.
* doc/m4.texinfo (Ifelse, Changequote): Add more tests.
(Incompatibilities): Fix typo.
* examples/wraplifo.m4: New file.
* examples/Makefile.am (EXTRA_DIST): Distribute it.

(cherry picked from commit 8b5b3b7a74f452fed795c063965966934a68755d)

Signed-off-by: Eric Blake <ebb9@byu.net>
ChangeLog
doc/m4.texinfo
examples/Makefile.am
examples/wraplifo.m4 [new file with mode: 0644]
src/input.c
src/m4.h
src/macro.c