[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: fatal pgawk error: unexpected type Node_regex in prec_level
From: |
Aharon Robbins |
Subject: |
Re: fatal pgawk error: unexpected type Node_regex in prec_level |
Date: |
Sun, 31 Jan 2010 22:50:36 +0200 |
Hi Hermann. Re this:
> Date: Fri, 29 Jan 2010 18:02:31 +0100
> From: Hermann Peifer <address@hidden>
> To: address@hidden
> Subject: fatal pgawk error: unexpected type Node_regex in prec_level
>
> Arnold,
>
> I noticed a weird behaviour of pgawk 3.1.7 under cygwin. Is this a bug,
> feature or some Windows thing?
>
> Regards, Hermann
>
> # Everything works fine with gawk
> $ gawk 'NR==FNR{a[$0];next}{ for (i in a) if (/The /) print }' list1 list2
> The one
> The one
> The one
> The three
> The three
> The three
>
> # Here I change the condition to "!/The /"
> $ gawk 'NR==FNR{a[$0];next}{ for (i in a) if (!/The /) print }' list1 list2
> two
> two
> two
>
> # Everything works fine with pgawk here...
> $ pgawk 'NR==FNR{a[$0];next}{ for (i in a) if (/The /) print }' list1 list2
> The one
> The one
> The one
> The three
> The three
> The three
>
> # ..but changing the condition to "!/The /" seems to trigger the error:
> $ pgawk 'NR==FNR{a[$0];next}{ for (i in a) if (!/The /) print }' list1 list2
> two
> two
> two
> pgawk: (FILENAME=list2 FNR=3) fatal: unexpected type Node_regex in
> prec_level
>
> $ cat list1
> one
> two
> three
>
> $ cat list2
> The one
> two
> The three
It's a bug. Thanks for the report. Patch below. This will wend
its way to CVS shortly.
Keep up the good work!
Arnold
--------------------------------------------------------------------------
Sun Jan 31 22:46:49 2010 Arnold D. Robbins <address@hidden>
* profile.c (prec_level): Add Node_regex to the switch so that
`! /xxx/' works. Thanks to Hermann Peifer <address@hidden> for
reporting the bug.
Index: profile.c
===================================================================
RCS file: /d/mongo/cvsrep/gawk-stable/profile.c,v
retrieving revision 1.15
diff -u -r1.15 profile.c
--- profile.c 28 Jan 2010 16:22:51 -0000 1.15
+++ profile.c 31 Jan 2010 20:45:32 -0000
@@ -1335,6 +1335,7 @@
case Node_RS:
case Node_SUBSEP:
case Node_TEXTDOMAIN:
+ case Node_regex:
return 15;
case Node_field_spec: