bug-gnu-utils
[Top][All Lists]
Advanced

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

Re: gawk version 3.1.0 will not print a ";"


From: Aharon Robbins
Subject: Re: gawk version 3.1.0 will not print a ";"
Date: Wed, 23 Jan 2002 14:55:33 +0200

Greetings again.  Re:

>       gawk '{print "Input = "$_" ; "}' tmp

My previous note explained the problem.  The following
patch makes things work better, although I'm not 100%
convinced it's The Right Thing.  In any case, it should
solve your immediate problem.

You will need to rebuild from source, either by loading the
Redhat SRPM, or downloading source from ftp.gnu.org.

Good luck,

Arnold Robbins

*** ../gawk-3.1.0/awkgram.y     Mon Apr 23 10:25:58 2001
--- awkgram.y   Wed Jan 23 14:45:51 2002
***************
*** 1816,1822 ****
                exit(1);
        }
  
!       if (! do_traditional && c == '_') {
                if ((c = nextc()) == '"') {
                        intlstr = TRUE;
                        goto string;
--- 1959,1979 ----
                exit(1);
        }
  
!       /*
!        * Lots of fog here.  Consider:
!        *
!        * print "xyzzy"$_"foo"
!        *
!        * Without the check for ` lasttok != '$'' ', this is parsed as
!        *
!        * print "xxyzz" $(_"foo")
!        *
!        * With the check, it is "correctly" parsed as three
!        * string concatenations.  Sigh.  This seems to be
!        * "more correct", but this is definitely one of those
!        * occasions where the interactions are funny.
!        */
!       if (! do_traditional && c == '_' && lasttok != '$') {
                if ((c = nextc()) == '"') {
                        intlstr = TRUE;
                        goto string;



reply via email to

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