支持多行增加了几个函数,看结果吧
0. 多行模式: 任意数量的> 开始 同等数量的< 结束
1. 文件系统函数 cd ls dir
2. 执行执行模版函数 exec(tmpl)
3. 错误行定位
4. 错误信息默认不显示详情, 使用 showLastException() 函数显示错误详情
5. 变量/常量导入全局变量/常量
============================================
Wellcome Webit Script World \(^o^)/
build:2014.06.02
QQ群:302505483
============================================
F:\Workspace\happy-console>
echo "Hello WS";
>>>
Hello WS
F:\Workspace\happy-console>
>>>
1| var sayHello = function(){
2| echo "I: Hello";
3| };
4| sayHello();
5| <<<
>>>
I: Hello
F:\Workspace\happy-console>
sayHello();
>>>
I: Hello
F:\Workspace\happy-console>
>>>
1| var sayHello = function(){
2| echo "Hello again";
3| };
4| <<<
>>>
F:\Workspace\happy-console>
sayHello();
>>>
Hello again
F:\Workspace\happy-console>
"Oops"
>>>
语法错误: Syntax error before: 2(7). Hints: forget ';' ?
1| "Oops"
^
F:\Workspace\happy-console>
showLastException();
>>>
webit.script.exceptions.ParseException: Syntax error before: 2(7). Hints: forget ';' ?
template: cmd:"Oops"
at line 1(7)
F:\Workspace\happy-console>
ls("R:");
>>>
Find 5 files:
System Volume Information
$RECYCLE.BIN
_FFCACHE
hello.wit
webit-script-1.4.2.jar
F:\Workspace\happy-console>
exec("R:\\hello.wit");
>>>
Hello WS
F:\Workspace\happy-console>
cd("R:");
>>>
R:\>
ls();
>>>
Find 5 files:
System Volume Information
$RECYCLE.BIN
_FFCACHE
hello.wit
webit-script-1.4.2.jar
R:\>
exec("hello.wit");
>>>
Hello WS
R:\>
exit();
>>>
Bye (^_^)∠※