Improve handling of $ in syntax table.
commitcc55111948ac37d1dd492bbef85364bf08ed2d2d
authorEric Blake <ebb9@byu.net>
Wed, 18 Feb 2009 13:56:38 +0000 (18 06:56 -0700)
committerEric Blake <ebb9@byu.net>
Wed, 18 Feb 2009 15:30:35 +0000 (18 08:30 -0700)
tree86bb407680e0865352ed343c1b470004c778bc13
parent10fb79cb4f4a4cb6a174d628c3304fee61596ff8
Improve handling of $ in syntax table.

* m4/m4module.h (m4_is_syntax_single_dollar): New function.
(M4_SYNTAX_DOLLAR, M4_SYNTAX_LBRACE, M4_SYNTAX_RBRACE): Change to
be context rather than basic syntax categories.
(M4_SYNTAX_MASKS): Adjust macro.
* m4/m4private.h (struct m4_syntax_table): Add dollar and
is_single_dollar members.
(m4_is_syntax_single_dollar): Add fast alternative.
* m4/syntax.c (m4_syntax_create, reset_syntax_set): Adjust to
account for change to context categories.
(m4_set_syntax): Manage is_single_dollar.
(m4_is_syntax_single_dollar): New function.
* m4/macro.c (locate_dollar): New helper function.
(process_macro): Use it to speed up macro expansion.
* m4/input.c (m4__next_token): Adjust client.
* doc/m4.texinfo (Changesyntax): Document this.

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