-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 According to Eric Blake on 10/28/2008 5:12 PM: >> Another possible cleanup left for later is to synthesize the proper format >> of the expansion stack message in m4_expansion_stack_push, as is done >> for m4_divert_stack_push. > > Yes, that needs to be done, but can come as a followup.
How about the following three patches? They make the stacks more robust to embedded $ (in file or macro names), make both stack dumps consistent (no newline either before or after the lines, just between, giving the user the most flexibility on how to apply the stack), and moves as much formatting as possible into the _push macros. The divert_stack was a bit tougher; I tightened up the code to enforce that the stack will never be empty except at the conclusion of m4_init, only to discover that clients that used m4_wrap([m4_divert_text]) for last-minute text tripped up the tighter checks. The third patch merely makes m4_undivert and m4_dumpdefs more user-friendly (m4_map_args is sure a fun interface!). Taking all three patches together, I even see a slight speedup on coreutils, from 9.709s to 9.548s. Any comments before I apply? - -- Don't work too hard, make some time for fun as well! Eric Blake [EMAIL PROTECTED] -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (Cygwin) Comment: Public key at home.comcast.net/~ericblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkkKcqUACgkQ84KuGfSFAYCCHwCgweprIRHjlOsDaSNK/F905ehS p7EAoNkQDGVgG1X9w1pH2MDc49y6rhRv =qi9d -----END PGP SIGNATURE-----
