CoffeeScript 死党,缩进语法死党,,, 一直想自己做的脚本... 现在好歹有一个了,(解析技巧太低级,正在找学长恶补...), 目前的解释器 https://github.com/jiyinyiyong/cirru-parser/blob/master/coffee/parse.coffee#L8 代码的预览.. https://github.com/jiyinyiyong/cirru-interpreter/tree/master/test/feature
echo ==== testing control flows
set a $ number 1
set b $ number 2
set c $ number 1
if (equal a b)
echo a equals b
echo a not equals b
if (equal a c)
echo a is c
if (equal c b)
echo b is c
print $ begin
print (number 1)
string somthing
number 0
语法极端简化
具体其他说明移步:http://jiyinyiyong.github.io/blog/posts/131004-cirru-status.html
自己玩得比较开心,但编码技巧上无力吐槽,, 不知道对他人是否有可取的地方...
再带两张图片,Sublime 上的代码高亮
Some update...
重写了 parser, online demo... http://jiyinyiyong.github.io/cirru-parser/html/ Code: https://github.com/jiyinyiyong/cirru-parser JSON 格式规则:https://github.com/jiyinyiyong/compact-json
编译到 Mustache (aka HTML...) https://github.com/jiyinyiyong/cirru-to-mustache Demo in Chrome http://jiyinyiyong.github.io/cirru-to-mustache/
比较原始 CodeMirror 语法高亮: https://github.com/jiyinyiyong/cirru-mode