quiroz@cs.rochester.edu (Cesar Quiroz) (10/03/89)
Consider the line marked `*' in this program:
gawk '
BEGIN { inleader=1; trailers=0 }
/^[ \t]*$/ && inleader { next }
inleader { inleader = 0; print; next }
* !inleader && /^[ \t]*$/ { trailers++; next }
!inleader { for (i=0; i<trailers; i++) printf "\n";
print; trailers=0; next }
'
Gnu Awk (gawk) 2.10beta 07 Apr 1989 complains about it:
gawk: syntax error near line 5:
!inleader && /^[ \t]*$/ { trailers++; next }
^ parse error
However, it parses correctly this version:
/^[ \t]*$/ && !inleader { trailers++; next }
[Aside: indeed, I can just drop the check on inleader in that
script, that is not the point.] In awk.y, the rule for simp_pattern
is suspect; I don't see how to generate the simple pattern
expression LEX_AND regexp. Perhaps it would be better to generate
expressions, simple regexps and dynamic regexps. Then derive
patterns from these three.
Thanks!
--
Cesar Augusto Quiroz Gonzalez
Department of Computer Science
University of Rochester
Rochester, NY 14627arnold@mathcs.emory.edu (Arnold D. Robbins {EUCC}) (10/08/89)
In article <1989Oct2.222916.4588@cs.rochester.edu> quiroz@cs.rochester.edu (Cesar Quiroz) writes: >Consider the line marked `*' in this program: > >* !inleader && /^[ \t]*$/ { trailers++; next } This has been fixed in GAWK 2.11, scheduled for release Real Soon Now. INEWS FODDER INEWS FODDER INEWS FODDER INEWS FODDER -- Arnold Robbins -- Emory U. Information Technology Div. | Laundry increases DOMAIN: arnold@emoryu1.cc.emory.edu | exponentially in the UUCP: gatech!emoryu1!arnold PHONE: +1 404 727-7636 | number of children. BITNET: arnold@emoryu1 FAX: +1 404 727-2599 | -- Miriam Hartholz
arnold@mathcs.emory.edu (Arnold D. Robbins {EUCC}) (10/10/89)
In article <1989Oct2.222916.4588@cs.rochester.edu> quiroz@cs.rochester.edu (Cesar Quiroz) writes: }}Consider the line marked `*' in this program: }} }}* !inleader && /^[ \t]*$/ { trailers++; next } In article <4422@emory.mathcs.emory.edu> arnold@emory.UUCP (Arnold D. Robbins {EUCC}) writes: >This has been fixed in GAWK 2.11, scheduled for release Real Soon Now. Sigh. I spoke too soon. It is still broke in 2.11. But it should be fixed (I hope) by the time 2.11 is out. There's Always One More Bug! -- Arnold Robbins -- Emory U. Information Technology Div. | Laundry increases DOMAIN: arnold@emoryu1.cc.emory.edu | exponentially in the UUCP: gatech!emoryu1!arnold PHONE: +1 404 727-7636 | number of children. BITNET: arnold@emoryu1 FAX: +1 404 727-2599 | -- Miriam Hartholz