From 4e176743612d8c07708cc2ba6d387cd364adb3a3 Mon Sep 17 00:00:00 2001 From: SpookyDervish <78246495+SpookyDervish@users.noreply.github.com> Date: Mon, 13 Oct 2025 18:03:13 +1100 Subject: [PATCH] updated examples a tiny bit gonna start work on actual compiler now --- debug/ast.json | 22 +++++++++++++++++++--- tests/parser.pla | 2 +- tests/types.pla | 3 ++- tests/variables.pla | 1 + 4 files changed, 23 insertions(+), 5 deletions(-) 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