forked from xxq250/Nasal-Interpreter
add static symbol check & test file update
This commit is contained in:
+20
-64
@@ -1,10 +1,10 @@
|
||||
#//This is written for Nasal Intepreter
|
||||
#//Sidi Liang
|
||||
|
||||
# This is written for Nasal Intepreter
|
||||
# Sidi Liang
|
||||
import("lib.nas");
|
||||
var w = 1;
|
||||
var x = "hello";
|
||||
var f = func(){
|
||||
print("f is called");
|
||||
println("f is called");
|
||||
}
|
||||
var f2 = func(){
|
||||
return 2;
|
||||
@@ -28,71 +28,27 @@ var z1 = {
|
||||
hashh:z
|
||||
};
|
||||
var y2 = [w, x, y, z1];
|
||||
|
||||
var z2 = {
|
||||
hashh: z1,
|
||||
listt2: y2,
|
||||
};
|
||||
|
||||
print(w);#//1
|
||||
print("\n");
|
||||
print(x);#//hello
|
||||
print("\n");
|
||||
print(y);#//Empty
|
||||
print("\n");
|
||||
print(z);#//Empty
|
||||
print("\n");
|
||||
print(z1);#//Empty
|
||||
print("\n");
|
||||
print(y2);#//Empty
|
||||
print("\n");
|
||||
print(y[0]);#//1
|
||||
print("\n");
|
||||
print(y1[2][1]);#//hello
|
||||
print("\n");
|
||||
print(z.numb);#//1
|
||||
print("\n");
|
||||
print(z.listt[2][1]);#//hello
|
||||
print("\n");
|
||||
print(z1.hashh.listt[2][1]);#//hello
|
||||
print("\n");
|
||||
print(y2[3].hashh.listt[2][1]);#//hello
|
||||
print("\n");
|
||||
print(f);#//Empty
|
||||
print("\n");
|
||||
println(w);#//1
|
||||
println(x);#//hello
|
||||
println(y);#//[1,hello]
|
||||
println(z);#//{...}
|
||||
println(z1);#//{...}
|
||||
println(y2);#//[...]
|
||||
println(y[0]);#//1
|
||||
println(y1[2][1]);#//hello
|
||||
println(z.numb);#//1
|
||||
println(z.listt[2][1]);#//hello
|
||||
println(z1.hashh.listt[2][1]);#//hello
|
||||
println(y2[3].hashh.listt[2][1]);#//hello
|
||||
println(f);#//func(...){...}
|
||||
f();#//f is called
|
||||
print("\n");
|
||||
print(z.funcc);#//Empty
|
||||
print("\n");
|
||||
println(z.funcc);#//func(...){...}
|
||||
z.funcc();#//f is called
|
||||
print("\n");
|
||||
print(z.funcccall);#//Empty
|
||||
print("\n");
|
||||
z.funcccall();#//f is called
|
||||
print("\n");
|
||||
println(z.funcccall);#//nil
|
||||
z2.listt2[3].hashh.funcc();#//f is called
|
||||
print("\n");
|
||||
print(y1[f2()][w]);#//hello
|
||||
print("\n");
|
||||
#//print(z.f3()); Error
|
||||
call(f);#//f is called
|
||||
print("\n");
|
||||
call(z.funcc);#//f is called
|
||||
print("\n");
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
println(y1[f2()][w]);#//hello
|
||||
Reference in New Issue
Block a user