diff --git a/ase/test/awk/awk.c b/ase/test/awk/awk.c index 38a08254..a80ad49d 100644 --- a/ase/test/awk/awk.c +++ b/ase/test/awk/awk.c @@ -1,5 +1,5 @@ /* - * $Id: awk.c,v 1.24 2006-04-18 16:27:29 bacon Exp $ + * $Id: awk.c,v 1.25 2006-04-19 02:52:53 bacon Exp $ */ #include @@ -58,10 +58,6 @@ static xp_ssize_t process_source ( #include #endif -#if defined(__STAND_ALONE) && defined(_WIN32) -#define xp_main _tmain -#endif - #if defined(__STAND_ALONE) && !defined(_WIN32) int main (int argc, char* argv[]) #else @@ -83,7 +79,7 @@ int xp_main (int argc, xp_char_t* argv[]) if (xp_awk_attsrc(awk, process_source, XP_NULL) == -1) { xp_awk_close (awk); - xp_printf (XP_TEXT("error: cannot attach source\n")); + xp_printf (XP_TEXT("Error: cannot attach source\n")); return -1; } diff --git a/ase/test/awk/makefile.cl b/ase/test/awk/makefile.cl index 340160a9..85f339ce 100644 --- a/ase/test/awk/makefile.cl +++ b/ase/test/awk/makefile.cl @@ -2,8 +2,7 @@ CC = cl #CFLAGS = /nologo /MT /W3 /GR- /D_WIN32_WINNT=0x0400 -I..\..\.. CFLAGS = /nologo /MT /W3 /GR- /D_WIN32_WINNT=0x0400 -I..\..\.. -D__STAND_ALONE LDFLAGS = /libpath:..\..\bas /libpath:..\..\awk -LIBS = xpbas.lib xpawk.lib -#LIBS = xpawk.lib +LIBS = xpawk.lib all: awk diff --git a/ase/test/awk/t2.awk b/ase/test/awk/t2.awk new file mode 100644 index 00000000..969f0fae --- /dev/null +++ b/ase/test/awk/t2.awk @@ -0,0 +1,25 @@ +global z, x; + +function sum (i) +{ + local k, y; + + y = 0; + for (k = i; k; k = k - 1) + { + y = y + k; + } + + return y; + y = 10; + return y; +} + +BEGIN +{ + x = sum (10000000); + //s = sum (100); + s = x; + ss = z; +} + diff --git a/ase/test/awk/t3.awk b/ase/test/awk/t3.awk new file mode 100644 index 00000000..a7e16c29 --- /dev/null +++ b/ase/test/awk/t3.awk @@ -0,0 +1,24 @@ +global x, j; + +func func1 (x) +{ + c = x["abc"]; + x["abc"] = 123; +} + +BEGIN +{ + idx="abc"; + x[idx] = 12345; + i = x[idx]; + + func1 (x); + k = x[idx]; + return j; + + /* + x["abc"] = 12345; + i = x["abc"]; + return j; + */ +}