summaryrefslogtreecommitdiffhomepage
path: root/tests/02_runtime/00_scoping
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2020-12-23 20:54:05 +0100
committerJo-Philipp Wich <jo@mein.io>2021-02-17 14:10:51 +0100
commit3756806674da909ec6dc10ad25862b592792604e (patch)
treef2af7e47f8444caaff0a5a33599f381889db24e3 /tests/02_runtime/00_scoping
parent77580a893283f2bde7ab46496bd3a3d7b2fc6784 (diff)
treewide: rewrite ucode interpreter
Replace the former AST walking interpreter implementation with a single pass bytecode compiler and a corresponding virtual machine. The rewrite lays the groundwork for a couple of improvements with will be subsequently implemented: - Ability to precompile ucode sources into binary byte code - Strippable debug information - Reduced runtime memory usage Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'tests/02_runtime/00_scoping')
-rw-r--r--tests/02_runtime/00_scoping14
1 files changed, 7 insertions, 7 deletions
diff --git a/tests/02_runtime/00_scoping b/tests/02_runtime/00_scoping
index 2bca2ab..5fadf43 100644
--- a/tests/02_runtime/00_scoping
+++ b/tests/02_runtime/00_scoping
@@ -12,7 +12,7 @@ c_global=true
c_local=false
-When seting a nonlet variable, it is set in the nearest parent
+When seting a nonlocal variable, it is set in the nearest parent
scope containing the variable or in the root scope if the variable
was not found.
@@ -25,13 +25,13 @@ Variables implicitly declared by for-in or counting for loops follow the same
scoping rules.
inner2 f_a=3
-inner2 f_b=3
+inner2 f_b=
inner2 f_c=3
-inner2 f_d=3
+inner2 f_d=
inner2 f_e=3
inner f_a=3
-inner f_b=3
+inner f_b=
inner f_c=3
inner f_d=
inner f_e=3
@@ -73,7 +73,7 @@ c_global={{ !!c_global }}
c_local={{ !!c_local }}
-When seting a nonlet variable, it is set in the nearest parent
+When seting a nonlocal variable, it is set in the nearest parent
scope containing the variable or in the root scope if the variable
was not found.
@@ -110,7 +110,7 @@ scoping rules.
{%
function scope3() {
- // f_a is not declared let and be set i nthe root scope
+ // f_a is not declared local and be set in the root scope
for (f_a = 1; f_a < 3; f_a++)
;
@@ -120,7 +120,7 @@ scoping rules.
let f_c;
function scope4() {
- // f_c is not declared let but declared in the parent scope, it
+ // f_c is not declared local but declared in the parent scope, it
// will be set there
for (f_c in [1, 2, 3])
;