Issue #2 expression fix, updated readme.

This commit is contained in:
Marvin Blum
2015-10-25 18:37:51 +01:00
parent bf283cb87a
commit 665c9e27a1
5 changed files with 10 additions and 4 deletions

View File

@@ -424,7 +424,7 @@ func parseIdentifier() string {
output += "("+get().token
next()
expect("[")
output += " select "+parseExpression(false)+")"
output += " select ("+parseExpression(false)+"))"
expect("]")
} else if accept("!") || accept("-") {
output = get().token

View File

@@ -131,7 +131,7 @@ func TestParserWaitUntil(t *testing.T) {
func TestParserArray(t *testing.T) {
got := getCompiled(t, "test/parser_array.asl")
want := "x = [1,2,3];\ny = (x select 1);\n"
want := "x = [1,2,3];\ny = (x select (1));\n"
equal(t, got, want)
}