[add] Added the test for sjscript.
This commit is contained in:
18
sjscript/test/parse.d
Executable file
18
sjscript/test/parse.d
Executable file
@@ -0,0 +1,18 @@
|
||||
#!/usr/bin/env dub
|
||||
/+ dub.json:
|
||||
{
|
||||
"name": "parse",
|
||||
"dependencies": {
|
||||
"sjscript": {"path": "../"}
|
||||
}
|
||||
} +/
|
||||
|
||||
import std;
|
||||
|
||||
import sjscript;
|
||||
|
||||
int main(string[] args) {
|
||||
enforce(args.length >= 2);
|
||||
args[1].readText.CreateScriptAst().writeln;
|
||||
return 0;
|
||||
}
|
16
sjscript/test/test01.sj
Normal file
16
sjscript/test/test01.sj
Normal file
@@ -0,0 +1,16 @@
|
||||
// this is comment
|
||||
|
||||
$define horming {
|
||||
translate_x += cos(atan(player_y, player_x)) * $horming_speed;
|
||||
translate_y += sin(atan(player_y, player_x)) * $horming_speed;
|
||||
}
|
||||
|
||||
A [0..10] {
|
||||
translate_x = 0.5 + sin(rtime)*0.5;
|
||||
translate_y = 0.5 + cos(rtime)*0.5;
|
||||
}
|
||||
|
||||
B [5..15] {
|
||||
$define horming_speed {0.1}
|
||||
$horming
|
||||
}
|
Reference in New Issue
Block a user