[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Little documentation bug
From: |
Eric Blake |
Subject: |
Re: Little documentation bug |
Date: |
Wed, 13 Aug 2014 20:06:44 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.7.0 |
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