mirror of
https://github.com/Kugelschieber/asl.git
synced 2026-01-18 03:50:25 +00:00
17
.project
17
.project
@@ -1,17 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<projectDescription>
|
|
||||||
<name>asl</name>
|
|
||||||
<comment></comment>
|
|
||||||
<projects>
|
|
||||||
</projects>
|
|
||||||
<buildSpec>
|
|
||||||
<buildCommand>
|
|
||||||
<name>com.googlecode.goclipse.goBuilder</name>
|
|
||||||
<arguments>
|
|
||||||
</arguments>
|
|
||||||
</buildCommand>
|
|
||||||
</buildSpec>
|
|
||||||
<natures>
|
|
||||||
<nature>com.googlecode.goclipse.core.goNature</nature>
|
|
||||||
</natures>
|
|
||||||
</projectDescription>
|
|
||||||
23
ToDo.md
23
ToDo.md
@@ -1,23 +0,0 @@
|
|||||||
# ToDo
|
|
||||||
|
|
||||||
* ~~assign to returned values~~
|
|
||||||
* ~~sqf: ... sqf whitespace~~
|
|
||||||
* ~~solution for build in commands which do not require left values~~
|
|
||||||
* ~~pretty/minified printing~~
|
|
||||||
* ~~usage~~
|
|
||||||
* ~~recursive compiling~~
|
|
||||||
* ~~concurrent compiling~~
|
|
||||||
* ~~inline buildin function call -> foo(a)(bar(x)(y));~~
|
|
||||||
* ~~negative values e.g. -1, operator !~~
|
|
||||||
* ~~tokenizer splits commands like "format" -> for, mat~~
|
|
||||||
* ~~try ... catch~~
|
|
||||||
* ~~better error reporting~~
|
|
||||||
- ~~recover panic~~
|
|
||||||
- ~~line, column~~
|
|
||||||
* type check for functions
|
|
||||||
|
|
||||||
## Special cases
|
|
||||||
|
|
||||||
* ~~exitWith...~~
|
|
||||||
* ~~waitUntil...~~
|
|
||||||
* ~~!buildInFunc()()...~~
|
|
||||||
6
build
Executable file
6
build
Executable file
@@ -0,0 +1,6 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
export GOROOT=/usr/local/go
|
||||||
|
export PATH=$PATH:$GOROOT/bin
|
||||||
|
export GOPATH=/home/marvin/Projekte/asl
|
||||||
|
go build -ldflags "-s -w" src/main/asl.go
|
||||||
6
run
Executable file
6
run
Executable file
@@ -0,0 +1,6 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
export GOROOT=/usr/local/go
|
||||||
|
export PATH=$PATH:$GOROOT/bin
|
||||||
|
export GOPATH=/home/marvin/Projekte/asl
|
||||||
|
go run src/main/asl.go $1 $2
|
||||||
6
run_tests
Executable file
6
run_tests
Executable file
@@ -0,0 +1,6 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
export GOROOT=/usr/local/go
|
||||||
|
export PATH=$PATH:$GOROOT/bin
|
||||||
|
export GOPATH=/home/marvin/Projekte/asl
|
||||||
|
go test parser tokenizer types
|
||||||
@@ -35,7 +35,7 @@ func TestParserIf(t *testing.T) {
|
|||||||
|
|
||||||
func TestParserWhile(t *testing.T) {
|
func TestParserWhile(t *testing.T) {
|
||||||
got := getCompiled(t, "../../test/tokenizer_while.asl")
|
got := getCompiled(t, "../../test/tokenizer_while.asl")
|
||||||
want := "while {true} do {\r\n};"
|
want := "while {true} do {\r\n};\r\n"
|
||||||
|
|
||||||
equal(t, got, want)
|
equal(t, got, want)
|
||||||
}
|
}
|
||||||
@@ -195,6 +195,14 @@ func TestParserExpressionArray(t *testing.T) {
|
|||||||
equal(t, got, want)
|
equal(t, got, want)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// bugfix: unary function parsing (e.g. "format")
|
||||||
|
func TestBugfixParserUnaryFunction(t *testing.T) {
|
||||||
|
got := getCompiled(t, "../../test/bugfix_unary_func_format.asl")
|
||||||
|
want := "format [\"%1 %2\", \"value1\", \"value2\"];\r\n[\"a\", \"b\", \"c\"] call someFunc;\r\n"
|
||||||
|
|
||||||
|
equal(t, got, want)
|
||||||
|
}
|
||||||
|
|
||||||
func getCompiled(t *testing.T, file string) string {
|
func getCompiled(t *testing.T, file string) string {
|
||||||
code, err := ioutil.ReadFile(file)
|
code, err := ioutil.ReadFile(file)
|
||||||
|
|
||||||
|
|||||||
2
test/bugfix_unary_func_format.asl
Normal file
2
test/bugfix_unary_func_format.asl
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
format("%1 %2", "value1", "value2"); // must result in format [...];
|
||||||
|
someFunc("a", "b", "c"); // must result in ... call someFunc;
|
||||||
Reference in New Issue
Block a user