m4-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: AT_LINE


From: Eric Blake
Subject: Re: AT_LINE
Date: Mon, 14 Sep 2009 05:58:57 -0600
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.23) Gecko/20090812 Thunderbird/2.0.0.23 Mnenhy/0.7.6.666

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Ralf Wildenhues on 9/13/2009 9:48 AM:
> all debug output will list line N as the originator for the checks.
> 
> Is it possible to realize in M4 in Autotest to list another or yet
> another line as line numbers?

Unfortunately, current m4 treats all text created by a macro expansion as
coming from line N where the macro name occurred; there is no way to ask
for a count of lines relative to the expansion.  Therefore, the only way I
know of to specify line numbers is to provide them as arguments to the
macro call.  That is, instead of:

foo([    # line n
bar      # reports line n
bar      # reports line n
])

you would use something like:

foo([            # line n
bar(]__line__[)  # bar called with line n+1
bar(]__line__[)  # bar called with line n+2
])

But that gets hairy fast, and AT_CHECK doesn't have an interface that
currently allows the specification of an alternate line number.

Maybe it would be nice to patch m4 to track __line__ usage within an
expanded macro relative to the number of newlines encountered during the
expansion, but that would be quite a bit of upstream effort, and won't
appear in a stable released version of m4 for quite some time.

This also reminds me that I have plans to implement __line__(value) for m4
1.6, which allows one to change the current reported line on the fly; but
I haven't gotten to that yet.

- --
Don't work too hard, make some time for fun as well!

Eric Blake             address@hidden
-----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/

iEYEARECAAYFAkquMAEACgkQ84KuGfSFAYCNiQCZAV76uy+JwKIDWrOMXBx4qwqX
u2cAoM0CP7EfKKqdBxXnGyhjIKOFidQL
=HymG
-----END PGP SIGNATURE-----




reply via email to

[Prev in Thread] Current Thread [Next in Thread]