diff --git a/debug/ast.json b/debug/ast.json index d67aa72..505760c 100644 --- a/debug/ast.json +++ b/debug/ast.json @@ -7,13 +7,29 @@ "expr": { "type": "InfixExpression", "left_node": { - "type": "IntegerLiteral", - "value": 5 + "type": "InfixExpression", + "left_node": { + "type": "InfixExpression", + "left_node": { + "type": "IntegerLiteral", + "value": 5 + }, + "operator": "+", + "right_node": { + "type": "IntegerLiteral", + "value": 5 + } + }, + "operator": "*", + "right_node": { + "type": "IntegerLiteral", + "value": 3 + } }, "operator": "+", "right_node": { "type": "IntegerLiteral", - "value": 5 + "value": 2 } } } diff --git a/tests/parser.pla b/tests/parser.pla index a4c9114..7da8b56 100644 --- a/tests/parser.pla +++ b/tests/parser.pla @@ -1 +1 @@ -5 + 5 \ No newline at end of file +(5 + 5) * 3 + 2 \ No newline at end of file diff --git a/tests/types.pla b/tests/types.pla index 0b29969..bc1a140 100644 --- a/tests/types.pla +++ b/tests/types.pla @@ -8,7 +8,8 @@ enum Gender { struct Person { name: String, age: Int = 0, - speak: Func + speak: Func, + gender: Gender } speak = Func(sentence: String): Nil { diff --git a/tests/variables.pla b/tests/variables.pla index b43cc42..cfcbef7 100644 --- a/tests/variables.pla +++ b/tests/variables.pla @@ -1,4 +1,5 @@ depend "string.pla" +depend "io.h" myInt: Int = 123 myDecimal: Float = 0.456