about summary refs log tree commit diff
path: root/users/tazjin/rlox/examples/scope.lox
diff options
context:
space:
mode:
Diffstat (limited to 'users/tazjin/rlox/examples/scope.lox')
-rw-r--r--users/tazjin/rlox/examples/scope.lox19
1 files changed, 19 insertions, 0 deletions
diff --git a/users/tazjin/rlox/examples/scope.lox b/users/tazjin/rlox/examples/scope.lox
new file mode 100644
index 000000000000..d563807943ba
--- /dev/null
+++ b/users/tazjin/rlox/examples/scope.lox
@@ -0,0 +1,19 @@
+var a = "global a";
+var b = "global b";
+var c = "global c";
+{
+  var a = "outer a";
+  var b = "outer b";
+  {
+    var a = "inner a";
+    print a;
+    print b;
+    print c;
+  }
+  print a;
+  print b;
+  print c;
+}
+print a;
+print b;
+print c;