updated examples a tiny bit

gonna start work on actual compiler now
This commit is contained in:
SpookyDervish
2025-10-13 18:03:13 +11:00
parent 985af13d6a
commit 4e17674361
4 changed files with 23 additions and 5 deletions

View File

@@ -5,6 +5,10 @@
"ExpressionStatement": { "ExpressionStatement": {
"type": "ExpressionStatement", "type": "ExpressionStatement",
"expr": { "expr": {
"type": "InfixExpression",
"left_node": {
"type": "InfixExpression",
"left_node": {
"type": "InfixExpression", "type": "InfixExpression",
"left_node": { "left_node": {
"type": "IntegerLiteral", "type": "IntegerLiteral",
@@ -15,6 +19,18 @@
"type": "IntegerLiteral", "type": "IntegerLiteral",
"value": 5 "value": 5
} }
},
"operator": "*",
"right_node": {
"type": "IntegerLiteral",
"value": 3
}
},
"operator": "+",
"right_node": {
"type": "IntegerLiteral",
"value": 2
}
} }
} }
} }

View File

@@ -1 +1 @@
5 + 5 (5 + 5) * 3 + 2

View File

@@ -8,7 +8,8 @@ enum Gender {
struct Person { struct Person {
name: String, name: String,
age: Int = 0, age: Int = 0,
speak: Func speak: Func,
gender: Gender
} }
speak = Func(sentence: String): Nil { speak = Func(sentence: String): Nil {

View File

@@ -1,4 +1,5 @@
depend "string.pla" depend "string.pla"
depend "io.h"
myInt: Int = 123 myInt: Int = 123
myDecimal: Float = 0.456 myDecimal: Float = 0.456