[Top][All Lists]

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

Re: FYI: variables: accept dashes

From: Joel E. Denny
Subject: Re: FYI: variables: accept dashes
Date: Thu, 23 Apr 2009 01:00:58 -0400 (EDT)

Hi Akim,

On Mon, 20 Apr 2009, Akim Demaille wrote:

> Le 20 avr. 09 ? 23:23, Akim Demaille a ?crit :
> > Pushed in master and branch-2.5.

> Actually I wrote this before even trying to push it, but it hardly goes into
> 2.5 which does not have the migration to using more %define.  Do we want to do
> it?  It seems it's going to be a lot of cherry-picking work :(
> I wanted to push it seem Joel preferred dashes to underscores in his newly
> introduced variables.

I was able to cherry-pick this patch into branch-2.5 without any other 
cherry-picking.  The main conflict was that I couldn't apply the bison.m4 
change, but that change isn't relevant in branch-2.5, right?  The other 
conflict relates to the change discussed below, and it's superficial.  
Did I miss anything?  I think it's a nice patch, and I'd like to use it.  
I haven't pushed.

> diff --git a/src/parse-gram.y b/src/parse-gram.y
> index 20dee8c..caa3d30 100644
> --- a/src/parse-gram.y
> +++ b/src/parse-gram.y
> @@ -535,15 +535,12 @@ rhs:
>  variable:
>    ID
> -| STRING { $$ = uniqstr_new ($1); } /* deprecated and not M4-friendly */
> +| STRING { $$ = uniqstr_new ($1); }
>  ;

The idea is that quotes around a variable name were deprecated in 2.3b.  
Moreover, that form is allowed to break Bison:

  % cat >tmp.y <<EOF
  %define "[" "value"
  start: ;
  % bison tmp.y 
  /home/jdenny/installs/m4/using/bin/m4:stdin:190: ERROR: end of file in string
  /home/jdenny/cs/bison/bison-git/src/bison: subsidiary program 
`/home/jdenny/installs/m4/using/bin/m4' failed (exit status 1)

Maybe the comment here just needed to be more descriptive?

reply via email to

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