Node:Forbidden Patterns, Previous:Evaluation Macros, Up:Programming in M4sugar



Forbidden Patterns

M4sugar provides a means to define suspicious patterns, patterns describing tokens which should not be found in the output. For instance, if an Autoconf configure script includes tokens such as AC_DEFINE, or dnl, then most probably something went wrong (typically a macro was not evaluated because of over quotation).

M4sugar forbids all the tokens matching ^m4_ and ^dnl$.

m4_pattern_forbid (pattern) Macro
Declare no token matching pattern must be found in the output. Comments are not checked; this can be a problem if, for instance, you have some macro left unexpanded after an #include. No consensus is currently found in the Autoconf community, as some people consider it should be valid to name macros in comments (which doesn't makes sense to the author of this documentation, as #-comments should document the output, not the input, documented vy dnl-comments).

Of course, you might encounter exceptions to these generic rules, for instance you might have to refer to $m4_flags.

m4_pattern_allow (pattern) Macro
Any token matching pattern is allowed, including if it matches an m4_pattern_forbid pattern.