diff --git a/lib.nas b/lib.nas index e3d2476..d367b58 100644 --- a/lib.nas +++ b/lib.nas @@ -448,11 +448,11 @@ var NM2M=1852; var R2D=180/math.pi; # functions that not supported in this runtime: -var bind=func(function,locals,outer_scope={}){ +var bind=func(function,locals,outer_scope=nil){ die("this runtime does not support bind"); } -var call=func(function,args=[],_me=nil,locals={},error=[]){ +var call=func(function,args=nil,_me=nil,locals=nil,error=nil){ die("this runtime does not support call"); } diff --git a/stl/lib.nas b/stl/lib.nas index e3d2476..d367b58 100644 --- a/stl/lib.nas +++ b/stl/lib.nas @@ -448,11 +448,11 @@ var NM2M=1852; var R2D=180/math.pi; # functions that not supported in this runtime: -var bind=func(function,locals,outer_scope={}){ +var bind=func(function,locals,outer_scope=nil){ die("this runtime does not support bind"); } -var call=func(function,args=[],_me=nil,locals={},error=[]){ +var call=func(function,args=nil,_me=nil,locals=nil,error=nil){ die("this runtime does not support call"); } diff --git a/test/ascii-art.nas b/test/ascii-art.nas index d0390cb..6b86218 100644 --- a/test/ascii-art.nas +++ b/test/ascii-art.nas @@ -1,4 +1,3 @@ -import("lib.nas"); var char_ttf=[ [" "," "," "," "," "," "], [" ████╗"," ██╔██║"," ██╔╝██║"," ███████║","██╔═══██║","╚═╝ ╚═╝"], diff --git a/test/auto_crash.nas b/test/auto_crash.nas index 092d3ed..9f08195 100644 --- a/test/auto_crash.nas +++ b/test/auto_crash.nas @@ -1,5 +1,4 @@ # Road check and auto pilot by ValKmjolnir -import("lib.nas"); import("test/props_sim.nas"); var dt=0.01; var intergral=0; diff --git a/test/bf.nas b/test/bf.nas index 9481522..374ef76 100644 --- a/test/bf.nas +++ b/test/bf.nas @@ -1,5 +1,3 @@ -import("lib.nas"); - var mandelbrot= "[A mandelbrot set fractal viewer in brainf*** written by Erik Bosman] +++++++++++++[->++>>>+++++>++>+<<<<<<]>>>>>++++++>--->>>>>>>>>>+++++++++++++++[[ diff --git a/test/bfcolored.nas b/test/bfcolored.nas index 3c897e3..4722f8b 100644 --- a/test/bfcolored.nas +++ b/test/bfcolored.nas @@ -1,5 +1,3 @@ -import("lib.nas"); - var mandelbrot= "[A mandelbrot set fractal viewer in brainf*** written by Erik Bosman] +++++++++++++[->++>>>+++++>++>+<<<<<<]>>>>>++++++>--->>>>>>>>>>+++++++++++++++[[ diff --git a/test/bfs.nas b/test/bfs.nas index 6917e11..8d0878c 100644 --- a/test/bfs.nas +++ b/test/bfs.nas @@ -1,8 +1,6 @@ -import("stl/lib.nas"); import("stl/queue.nas"); rand(time(0)); - var pixel=[' ','#','.','*']; var map=[]; for(var i=0;i<10;i+=1) diff --git a/test/bp.nas b/test/bp.nas index db65e86..ccf8814 100644 --- a/test/bp.nas +++ b/test/bp.nas @@ -1,5 +1,3 @@ -import("lib.nas"); - rand(time(0)); var new_neuron=func() diff --git a/test/calc.nas b/test/calc.nas index 505c104..e01e74b 100644 --- a/test/calc.nas +++ b/test/calc.nas @@ -1,4 +1,3 @@ -import("lib.nas"); var source=[ "main.cpp ", "nasal_err.h ", diff --git a/test/choice.nas b/test/choice.nas index 6de525d..b599e43 100644 --- a/test/choice.nas +++ b/test/choice.nas @@ -1,4 +1,3 @@ -import("lib.nas"); var condition_true=1; var condition_false=0; if(condition_true) diff --git a/test/class.nas b/test/class.nas index 9951a67..c326a05 100644 --- a/test/class.nas +++ b/test/class.nas @@ -1,5 +1,3 @@ -import("lib.nas"); - var student=func(n,a){ return { print_info:func println(n,' ',a), diff --git a/test/exception.nas b/test/exception.nas index b459935..207e62b 100644 --- a/test/exception.nas +++ b/test/exception.nas @@ -1,5 +1,3 @@ -import("lib.nas"); - var ResultTrait={ Ok:func(val){ me.ok=val; diff --git a/test/fib.nas b/test/fib.nas index 06818cf..5094505 100644 --- a/test/fib.nas +++ b/test/fib.nas @@ -1,4 +1,3 @@ -import("lib.nas"); var fib=func(x) { if(x<2) return x; diff --git a/test/filesystem.nas b/test/filesystem.nas index f244dc0..3891b4f 100644 --- a/test/filesystem.nas +++ b/test/filesystem.nas @@ -1,5 +1,3 @@ -import("lib.nas"); - var fd=io.open("test/filesystem.nas"); while((var line=io.readln(fd))!=nil) println(line); diff --git a/test/hexdump.nas b/test/hexdump.nas index 2c554a8..f52ba46 100644 --- a/test/hexdump.nas +++ b/test/hexdump.nas @@ -1,8 +1,6 @@ # hexdump.nas by ValKmjolnir # 2021/8/13 -import("lib.nas"); - # init var hex_num=[ '0','1','2','3', diff --git a/test/json.nas b/test/json.nas index 8e70a08..1de6b9d 100644 --- a/test/json.nas +++ b/test/json.nas @@ -1,6 +1,4 @@ #lib json.nas -import("lib.nas"); - var JSON=func(){ var ( diff --git a/test/leetcode1319.nas b/test/leetcode1319.nas index d89c63b..5da0642 100644 --- a/test/leetcode1319.nas +++ b/test/leetcode1319.nas @@ -1,4 +1,3 @@ -import("lib.nas"); # union set var n=4; var input=[[0,1],[0,2],[1,2]]; diff --git a/test/lexer.nas b/test/lexer.nas index aeb8980..3f2c3dd 100644 --- a/test/lexer.nas +++ b/test/lexer.nas @@ -1,5 +1,3 @@ -import("lib.nas"); - var lexer=func(file) { var (ptr,token)=(0,[]); diff --git a/test/life.nas b/test/life.nas index cefe744..a137477 100644 --- a/test/life.nas +++ b/test/life.nas @@ -1,5 +1,3 @@ -import("lib.nas"); - var map=nil; var check=func(x,y) diff --git a/test/loop.nas b/test/loop.nas index 4a6bc74..43e000a 100644 --- a/test/loop.nas +++ b/test/loop.nas @@ -1,4 +1,3 @@ -import("lib.nas"); for(;;)break; for(;;) { diff --git a/test/mandel.nas b/test/mandel.nas index ecdaa8a..6927856 100644 --- a/test/mandel.nas +++ b/test/mandel.nas @@ -1,5 +1,4 @@ #automatically generated by bfconvertor.nas -import('lib.nas'); var ptr=0; var paper=[]; setsize(paper,131072); diff --git a/test/mandelbrot.nas b/test/mandelbrot.nas index 3f2eaf0..a893254 100644 --- a/test/mandelbrot.nas +++ b/test/mandelbrot.nas @@ -1,4 +1,3 @@ -import("lib.nas"); var (yMin,yMax,xMin,xMax,line)=(-0.2,0.2,-1.5,-1.0,""); var (yDel,xDel)=(yMax-yMin,xMax-xMin); for(var yPixel=0;yPixel<24;yPixel+=1) diff --git a/test/md5.nas b/test/md5.nas index 9ba6e7b..9d3973c 100644 --- a/test/md5.nas +++ b/test/md5.nas @@ -1,5 +1,3 @@ -import("lib.nas"); - var check=func(x){ if(x<0x100000000) return x; diff --git a/test/module_test.nas b/test/module_test.nas index fa48d22..bfd2f33 100644 --- a/test/module_test.nas +++ b/test/module_test.nas @@ -1,4 +1,3 @@ -import("lib.nas"); import("./module/libfib.nas"); println(libfib); diff --git a/test/nasal_test.nas b/test/nasal_test.nas index d62659f..90501c8 100644 --- a/test/nasal_test.nas +++ b/test/nasal_test.nas @@ -1,6 +1,5 @@ # This is written for Nasal Intepreter # Sidi Liang -import("lib.nas"); var w = 1; var x = "hello"; var f = func(){ diff --git a/test/prime.nas b/test/prime.nas index ea57132..7f179d1 100644 --- a/test/prime.nas +++ b/test/prime.nas @@ -1,5 +1,3 @@ -import("lib.nas"); - var is_prime=func(x){ for(var i=2;i