aboutsummaryrefslogtreecommitdiffstats
path: root/test/nsfuncrecurse.awk
diff options
context:
space:
mode:
Diffstat (limited to 'test/nsfuncrecurse.awk')
-rw-r--r--test/nsfuncrecurse.awk18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/nsfuncrecurse.awk b/test/nsfuncrecurse.awk
new file mode 100644
index 00000000..1a006ceb
--- /dev/null
+++ b/test/nsfuncrecurse.awk
@@ -0,0 +1,18 @@
+@namespace "foo"
+
+function test(v)
+{
+ if (v <= 0)
+ return
+
+ Level++
+ v--
+ printf("Level = %d, v = %d\n", Level, v)
+ test(v)
+ Level--
+}
+
+BEGIN {
+ Level = 0
+ test(5)
+}