fixed a bug of not checking a parameter name against the function name
This commit is contained in:
@ -1,3 +0,0 @@
|
||||
|
||||
function f(f) { print f; }
|
||||
BEGIN { f("hello"); }
|
@ -1,5 +0,0 @@
|
||||
function f(f)
|
||||
{
|
||||
print f;
|
||||
f("my hello");
|
||||
}
|
@ -1,3 +0,0 @@
|
||||
# should print 50
|
||||
function fn(f) { f = 20; }
|
||||
BEGIN { f = 50; fn(100); print f; }
|
@ -1,3 +0,0 @@
|
||||
# A function and a named variable cannot have the same name.
|
||||
function a () { }
|
||||
BEGIN { a = 20; }
|
@ -1,3 +0,0 @@
|
||||
function a () { }
|
||||
BEGIN { local a; a = 20; }
|
||||
|
@ -1,2 +0,0 @@
|
||||
global a;
|
||||
function a () { }
|
@ -1,4 +0,0 @@
|
||||
function fn () { a = 20; return a;}
|
||||
global a;
|
||||
BEGIN { a = 30; print fn (); print a; }
|
||||
|
@ -1,16 +0,0 @@
|
||||
global x;
|
||||
BEGIN {
|
||||
x = 1;
|
||||
{
|
||||
local x;
|
||||
x = 2;
|
||||
{
|
||||
local x;
|
||||
x = 3;
|
||||
print x;
|
||||
}
|
||||
print x;
|
||||
}
|
||||
print x;
|
||||
}
|
||||
|
Reference in New Issue
Block a user