From 73f73d81c6b090514e8e44428e4c435ddfa0443e Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Mon, 24 Dec 2007 02:11:27 +0000 Subject: [PATCH] --- ase/test/awk/lang-001.awk | 3 +++ ase/test/awk/lang-002.awk | 5 +++++ ase/test/awk/lang-003.awk | 3 +++ ase/test/awk/lang-004.awk | 3 +++ ase/test/awk/lang-005.awk | 3 +++ ase/test/awk/lang-006.awk | 2 ++ ase/test/awk/lang-007.awk | 4 ++++ ase/test/awk/lang-008.awk | 16 ++++++++++++++++ 8 files changed, 39 insertions(+) create mode 100644 ase/test/awk/lang-001.awk create mode 100644 ase/test/awk/lang-002.awk create mode 100644 ase/test/awk/lang-003.awk create mode 100644 ase/test/awk/lang-004.awk create mode 100644 ase/test/awk/lang-005.awk create mode 100644 ase/test/awk/lang-006.awk create mode 100644 ase/test/awk/lang-007.awk create mode 100644 ase/test/awk/lang-008.awk diff --git a/ase/test/awk/lang-001.awk b/ase/test/awk/lang-001.awk new file mode 100644 index 00000000..47cfef01 --- /dev/null +++ b/ase/test/awk/lang-001.awk @@ -0,0 +1,3 @@ + +function f(f) { print f; } +BEGIN { f("hello"); } diff --git a/ase/test/awk/lang-002.awk b/ase/test/awk/lang-002.awk new file mode 100644 index 00000000..331dfac9 --- /dev/null +++ b/ase/test/awk/lang-002.awk @@ -0,0 +1,5 @@ +function f(f) +{ + print f; + f("my hello"); +} diff --git a/ase/test/awk/lang-003.awk b/ase/test/awk/lang-003.awk new file mode 100644 index 00000000..36b4ea59 --- /dev/null +++ b/ase/test/awk/lang-003.awk @@ -0,0 +1,3 @@ +# should print 50 +function fn(f) { f = 20; } +BEGIN { f = 50; fn(100); print f; } diff --git a/ase/test/awk/lang-004.awk b/ase/test/awk/lang-004.awk new file mode 100644 index 00000000..93591f81 --- /dev/null +++ b/ase/test/awk/lang-004.awk @@ -0,0 +1,3 @@ +# A function and a named variable cannot have the same name. +function a () { } +BEGIN { a = 20; } diff --git a/ase/test/awk/lang-005.awk b/ase/test/awk/lang-005.awk new file mode 100644 index 00000000..b8f66dff --- /dev/null +++ b/ase/test/awk/lang-005.awk @@ -0,0 +1,3 @@ +function a () { } +BEGIN { local a; a = 20; } + diff --git a/ase/test/awk/lang-006.awk b/ase/test/awk/lang-006.awk new file mode 100644 index 00000000..ff102b0c --- /dev/null +++ b/ase/test/awk/lang-006.awk @@ -0,0 +1,2 @@ +global a; +function a () { } diff --git a/ase/test/awk/lang-007.awk b/ase/test/awk/lang-007.awk new file mode 100644 index 00000000..3cbc4953 --- /dev/null +++ b/ase/test/awk/lang-007.awk @@ -0,0 +1,4 @@ +function fn () { a = 20; return a;} +global a; +BEGIN { a = 30; print fn (); print a; } + diff --git a/ase/test/awk/lang-008.awk b/ase/test/awk/lang-008.awk new file mode 100644 index 00000000..efbff863 --- /dev/null +++ b/ase/test/awk/lang-008.awk @@ -0,0 +1,16 @@ +global x; +BEGIN { + x = 1; + { + local x; + x = 2; + { + local x; + x = 3; + print x; + } + print x; + } + print x; +} +