This commit is contained in:
hyung-hwan 2007-12-24 02:11:27 +00:00
parent 2c557f097a
commit 73f73d81c6
8 changed files with 39 additions and 0 deletions

View File

@ -0,0 +1,3 @@
function f(f) { print f; }
BEGIN { f("hello"); }

View File

@ -0,0 +1,5 @@
function f(f)
{
print f;
f("my hello");
}

View File

@ -0,0 +1,3 @@
# should print 50
function fn(f) { f = 20; }
BEGIN { f = 50; fn(100); print f; }

View File

@ -0,0 +1,3 @@
# A function and a named variable cannot have the same name.
function a () { }
BEGIN { a = 20; }

View File

@ -0,0 +1,3 @@
function a () { }
BEGIN { local a; a = 20; }

View File

@ -0,0 +1,2 @@
global a;
function a () { }

View File

@ -0,0 +1,4 @@
function fn () { a = 20; return a;}
global a;
BEGIN { a = 30; print fn (); print a; }

16
ase/test/awk/lang-008.awk Normal file
View File

@ -0,0 +1,16 @@
global x;
BEGIN {
x = 1;
{
local x;
x = 2;
{
local x;
x = 3;
print x;
}
print x;
}
print x;
}