fixed a parser bug in awk.

- handling of idiv operators
- tokenization of /=/ as a regular expression
- calling QSE_AWK_FREEREX to free compiled regular expressions.
switched to a new regular expression handler.
This commit is contained in:
2009-12-11 07:03:54 +00:00
parent 93adbf9244
commit faea2475ac
17 changed files with 2089 additions and 3870 deletions

View File

@ -0,0 +1,18 @@
BEGIN {
print //;
print /=/;
print /.*/;
a=5; a /= 10; print a;
for (IGNORECASE=0; IGNORECASE<=1;IGNORECASE++)
{
print "IGNORECASE=", IGNORECASE;
print "abc" ~ /^[[:upper:]]+$/;
print "abc" ~ /^[[:lower:]]+$/;
print "ABC" ~ /^[[:upper:]]+$/;
print "ABC" ~ /^[[:lower:]]+$/;
print "AbC" ~ /^[[:upper:]]+$/;
print "aBc" ~ /^[[:lower:]]+$/;
}
}

View File

@ -2046,6 +2046,46 @@ BEGIN {
}
2010
--------------------------------------------------------------------------------
../../cmd/awk/.libs/qseawk --newline=on -o- -f lang-042.awk </dev/stdin 2>&1
--------------------------------------------------------------------------------
BEGIN {
print //;
print /=/;
print /.*/;
a = 5;
a /= 10;
print a;
for (IGNORECASE = 0; (IGNORECASE <= 1); (IGNORECASE)++)
{
print "IGNORECASE=",IGNORECASE;
print ("abc" ~ /^[[:upper:]]+$/);
print ("abc" ~ /^[[:lower:]]+$/);
print ("ABC" ~ /^[[:upper:]]+$/);
print ("ABC" ~ /^[[:lower:]]+$/);
print ("AbC" ~ /^[[:upper:]]+$/);
print ("aBc" ~ /^[[:lower:]]+$/);
}
}
1
0
1
0.5
IGNORECASE= 0
0
1
1
0
0
0
IGNORECASE= 1
1
1
1
1
1
1
--------------------------------------------------------------------------------
../../cmd/awk/.libs/qseawk -f quicksort.awk quicksort.dat </dev/stdin 2>&1
--------------------------------------------------------------------------------

View File

@ -152,6 +152,7 @@ PROGS="
lang-039.awk///--newline=on -o-
lang-040.awk///--newline=on -o-
lang-041.awk///--newline=on -o-
lang-042.awk///--newline=on -o-
quicksort.awk/quicksort.dat//
quicksort2.awk/quicksort2.dat//