diff --git a/analyzers/test/test.y b/analyzers/test/test.y index 82884f1..2941ff0 100644 --- a/analyzers/test/test.y +++ b/analyzers/test/test.y @@ -123,6 +123,7 @@ types_list: // condition condition: IF var_multiple_short_declaration SEMICOLON log_expr block else_part + | IF identifiers_list ASSIGN math_expr_or_literals_list SEMICOLON log_expr block else_part | IF log_expr block else_part else_part: diff --git a/tests/test.txt b/tests/test.txt index cc409f9..c189c23 100644 --- a/tests/test.txt +++ b/tests/test.txt @@ -34,6 +34,7 @@ func test(a int, b string) { func main() { + CubeRoot(123.1); var a int; diff --git a/tests/test_if.txt b/tests/test_if.txt index 1466ca0..bfdc451 100644 --- a/tests/test_if.txt +++ b/tests/test_if.txt @@ -51,6 +51,13 @@ func isValid() bool { func shouldReturn() bool { return false; } + + +if app, err = models.InitApp(); err != nil { + log.Fatal(err); +} + + if a, b := 1, 2; a < b && b < 3 { } if y := 20; y > 15 { diff --git a/tests/test_types.txt b/tests/test_types.txt index 085b0dc..d67bb5d 100644 --- a/tests/test_types.txt +++ b/tests/test_types.txt @@ -27,7 +27,7 @@ func main() { var p models.Person; var a,b,c,d models.Person; - var a,b,c models.Person = models.Person{"Tom", 24}, models.Person{"Tom", 24}, models.Person{"Tom", 24}; + var a,b,c models.Person = models.Person{name:"Tom", age:24}, models.Person{"Tom", 24}, models.Person{"Tom", 24}; var p models.Person = person{};