mirror of
https://github.com/ValKmjolnir/Nasal-Interpreter.git
synced 2026-07-23 03:18:43 +08:00
fully functional closure & add benchmark
This commit is contained in:
@@ -163,6 +163,8 @@ var func_table=[
|
||||
var bf=func(program)
|
||||
{
|
||||
setsize(paper,131072);
|
||||
for(var i=0;i<131072;i+=1)
|
||||
paper[i]=0;
|
||||
(ptr,code,inum,stack)=(0,[],[],[]);
|
||||
var len=size(program);
|
||||
|
||||
@@ -234,6 +236,7 @@ var bf=func(program)
|
||||
die("lack ]");
|
||||
return;
|
||||
}
|
||||
|
||||
len=size(code);
|
||||
for(pc=0;pc<len;pc+=1)
|
||||
code[pc]();
|
||||
|
||||
+1
-3
@@ -63,6 +63,4 @@ a(); # 2048 1024 -1
|
||||
b(); # 2048 1024 1 1
|
||||
|
||||
m.h()(2147483647);
|
||||
m.a();
|
||||
# flightgear-nasal-console: 2147483647 1024
|
||||
# nasal-interpreter 2048 1024
|
||||
m.a();# 2147483647 1024
|
||||
+4893
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user