diff --git a/doc/README_zh.md b/doc/README_zh.md index 43bbaa3..7c02eb2 100644 --- a/doc/README_zh.md +++ b/doc/README_zh.md @@ -19,7 +19,7 @@ * [__开发历史__](../doc/dev_zh.md) * [__测试数据__](../doc/benchmark.md) * [__特殊之处__](#与andy解释器的不同之处) -* [__堆栈追踪信息__](#trace-back-info) +* [__堆栈追踪信息__](#堆栈追踪信息) * [__调试器__](#调试器) __如果有好的意见或建议,欢迎联系我们!__ diff --git a/doc/nasal-http-test-web.html b/doc/nasal-http-test-web.html index a4f8307..0119175 100644 --- a/doc/nasal-http-test-web.html +++ b/doc/nasal-http-test-web.html @@ -51,7 +51,7 @@

The interpreter is totally rewritten by ValKmjolnir using C++(-std=c++11) without reusing the code in Andy Ross's nasal interpreter. But we really appreciate that Andy created this amazing programming language and his interpreter project. - Now this project uses GPL-2.0 license (2021/5/4).
+ Now this project uses GPL-2.0 license.

这个解释器是由ValKmjolnir用C++11编写的,完全没有复用Andy Ross版解释器的代码。但是我们仍然非常感谢Andy为我们带来了这么一款有趣的编程语言。 @@ -71,14 +71,21 @@ nasal运行brainfuck绘制的曼德勃罗集合(右)。

- Nasal can run this test file(test/bfcolored.nas) to draw this picture in about 220 seconds. + Nasal can run this test file(test/bf.nas) to draw this picture in about 220 seconds. In fact this test file cost over 2200 seconds before ver 8.0 .

- Nasal现在可以在220秒内运行该文件(test/bfcolored.nas)并绘制出这张图。 + Nasal现在可以在220秒内运行该文件(test/bf.nas)并绘制出这张图。 在8.0版本中这个解释器需要跑超过2200秒来绘制这张图。

+

+ The figure below is the feigenbaum-figure generated by ppm script written in nasal. +

+

+ 下方是使用 nasal 的 ppm 生成脚本生成的 feigenbaum 图形。 +

+

 Example | 样例代码

diff --git a/doc/pic/feigenbaum.png b/doc/pic/feigenbaum.png new file mode 100644 index 0000000..50c3929 Binary files /dev/null and b/doc/pic/feigenbaum.png differ diff --git a/src/nasal_builtin.cpp b/src/nasal_builtin.cpp index 73a90c7..93eb303 100644 --- a/src/nasal_builtin.cpp +++ b/src/nasal_builtin.cpp @@ -369,16 +369,16 @@ var builtin_find(var* local, gc& ngc) { var builtin_type(var* local, gc& ngc) { switch(local[1].type) { - case vm_none: return ngc.newstr("undefined");break; - case vm_nil: return ngc.newstr("nil"); break; - case vm_num: return ngc.newstr("num"); break; - case vm_str: return ngc.newstr("str"); break; - case vm_vec: return ngc.newstr("vec"); break; - case vm_hash: return ngc.newstr("hash"); break; - case vm_func: return ngc.newstr("func"); break; - case vm_obj: return ngc.newstr("obj"); break; - case vm_co: return ngc.newstr("coroutine");break; - case vm_map: return ngc.newstr("mapper"); break; + case vm_none: return ngc.newstr("undefined"); + case vm_nil: return ngc.newstr("nil"); + case vm_num: return ngc.newstr("num"); + case vm_str: return ngc.newstr("str"); + case vm_vec: return ngc.newstr("vec"); + case vm_hash: return ngc.newstr("hash"); + case vm_func: return ngc.newstr("func"); + case vm_obj: return ngc.newstr("obj"); + case vm_co: return ngc.newstr("coroutine"); + case vm_map: return ngc.newstr("namespace"); } return nil; } diff --git a/test/feigenbaum.nas b/test/feigenbaum.nas new file mode 100644 index 0000000..6f1535d --- /dev/null +++ b/test/feigenbaum.nas @@ -0,0 +1,48 @@ +import.std.process_bar; + +var ppm=func(filename, width, height, RGB){ + # P3 use ASCII number + # P6 use binary character + var fd = io.open(filename, "wb"); + io.write(fd, "P6\n"~width~" "~height~"\n255\n"); + for(var i = 0; i