Revamp changesyntax vs. changequote interactions.
commite5632a42071a39b1e6988533aeb2aeab16188b85
authorEric Blake <ebb9@byu.net>
Sat, 14 Feb 2009 17:14:34 +0000 (14 10:14 -0700)
committerEric Blake <ebb9@byu.net>
Mon, 16 Feb 2009 13:37:15 +0000 (16 06:37 -0700)
tree185faffe4b1d5b60f3dfc547f60f346ec4420ade
parent1e2cb352077020f928c9e6c700880276ea79d729
Revamp changesyntax vs. changequote interactions.

* m4/m4module.h (M4_SYNTAX_VALUE): Delete unused macro.
(M4_SYNTAX_SUSPECT): New macro.
* m4/m4private.h (struct m4_syntax_table): Add suspect field.
* m4/syntax.c (check_is_single_quotes, check_is_single_comments)
(check_is_macro_escaped): Delete, by inlining body...
(m4_set_syntax): ...into here.  Improves handling between
changesyntax and changequote/changecom.
(add_syntax_set, subtract_syntax_set, set_syntax_set): Simplify,
and let suspect field track needed cleanup.
(m4_set_quotes, m4_set_comment): Adjust meaning of
is_single_quotes and is_single_comment flags to always be true if
only one delimiter exists, regardless of its length.  Ensure that
the syntax categories M4_SYNTAX_LQUOTE and M4_SYNTAX_BCOMM are
only used on 1-byte delimiters.
(add_syntax_attribute, remove_syntax_attribute): Change signature
to allow the use of fewer casts.  Adjust the suspect field when
necessary.
(m4_reset_syntax, set_quote_age): Adjust callers.
* m4/input.c (m4__next_token, m4__next_token_is_open): Simplify
callers.
* doc/m4.texinfo (Changesyntax): Update documentation and tests.

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