bug-m4
[Top][All Lists]
Advanced

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

Re: frozen files format 2


From: Gary V. Vaughan
Subject: Re: frozen files format 2
Date: Fri, 23 Jun 2006 11:12:49 +0100
User-agent: Thunderbird 1.5.0.4 (Macintosh/20060530)

Hi Eric,

Eric Blake wrote:
> Eric Blake <ebb9 <at> byu.net> writes:
> 
>> Ouch.  We aren't compatible here, without adding the feature of partial 
>> input 
>> across EOF.  With Solaris 8:
>>
>> $ echo "m4wrap(\`abc)
>>> ')len(" | m4
>> NONE:0: m4: ERROR: EOF in argument list
>> $ echo "m4wrap(\`abc)
>>> ')len(" | /usr/ccs/bin/m4
>> 3
> 
> It looks like Solaris doesn't mind EOF during argument collection, but does 
> mind EOF during strings:
> 
> $ echo "define(a,\`1" > a.m4   
> $ echo "2')a" > b.m4
> $ m4 a.m4 b.m4
> NONE:0: m4: ERROR: EOF in string
> $ /usr/ccs/bin/m4 a.m4 b.m4
> 
> /usr/ccs/bin/m4:a.m4:2 EOF in quote
> define(a,1
> )
> $ 
> 
> But if we are going to allow partial input, I would argue that partial 
> strings 
> should not behave any differently than partial arguments

Agreed.

> when we are not in -G/--traditional mode.

Why the distinction for --traditional?  I don't see a problem with
supporting EOF in quotes or definitions regardless of mode.. in much the
same way that we handle 10 or more arguments to macros.

We do, however, need to be careful to still throw correct diagnostics
when we genuinely fall off the end of the last file.  Perhaps we should
also be clever about EOF across boundaries between named files and
stdin.  For example:

  $ echo "len(" > a.m4
  $ echo "abc)" > b.m4
  $ m4 a.m4 b.m4
  3
  $ m4 a.m4 -
  NONE:0: m4: ERROR: EOF in argument list

The rationale being that the 'm4 a.m4 -' idiom is for slurping setup
from a.m4 for an interactive session.

Cheers,
        Gary.
-- 
Gary V. Vaughan      ())_.  address@hidden,gnu.org}
Research Scientist   ( '/   http://blog.azazil.net
GNU Hacker           / )=   http://trac.azazil.net/projects/libtool
Technical Author   `(_~)_   http://sources.redhat.com/autobook

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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