On 08/13/2014 06:06 PM, Florian Mayer wrote: > Hello m4 Team, > > i think i have found a little bug in the latest > version of the m4 manual! >
Thanks for the report. However... > define(`foo', `Macro `FOO'.') > ⇒ > changequote(`', `') > ⇒ > foo > ⇒Macro `FOO'. > `foo' > ⇒`Macro `FOO'.' > changequote(`,) > ⇒ > foo > ⇒Macro FOO. Did you actually test this? Running 'make check' does just that, and verifies that the manual matches actual operation. This really is what gets output. > > ==end== > > That last line has to be > > ⇒Macro `FOO'. That is not the output for this example. Remember, the way m4 works is that any time a macro is expanded, the expansion is rescanned for macros. So functionally, you are at a point in time where the quotes are restored to their defaults of ` and ' (changequote defaults the end quote to ' rather than empty). The parser read: foo and expanded that to Macro `FOO'. then rescans; during the rescan, it sees that Macro is a potential name but has no expansion defined, sees a space, then sees a string (stripping the quotes before outputting the string contents FOO), then sees a dot, for a final output of: Macro FOO. as correctly documented. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature