feat: execute source control flow and exact real arithmetic

This commit is contained in:
2026-11-12 10:48:27 +08:00
parent f3e1670c58
commit 5ff1c68f5f
28 changed files with 1045 additions and 117 deletions
+5 -1
View File
@@ -21,12 +21,16 @@ module Endor {
StmtKind = Binding(Binding binding)
| Assignment(Assignment assignment)
| MemberAssignment(MemberAssignment assignment)
| If(IfStatement statement)
| While(WhileStatement statement)
| Return(ReturnStatement statement)
| Expression(Expr expression)
| Declaration(Decl declaration)
Binding = (Name name, Expr value, span span)
Assignment = (Name name, Expr value, span span)
MemberAssignment = (Expr object, Name name, Expr value, span span)
IfStatement = (Expr condition, Block body, Block? otherwise, span span)
WhileStatement = (Expr condition, Block body, span span)
ReturnStatement = (Expr? value, span span)
InteractiveInput = (Stmt* statements, span span)
@@ -41,5 +45,5 @@ module Endor {
| Member(Expr object, Name name)
| Call(Expr callee, Expr* arguments)
UnaryOp = Negate
BinaryOp = Add | Subtract | Multiply | Divide
BinaryOp = Add | Subtract | Multiply | Divide | Equal | NotEqual | Less | LessEqual | Greater | GreaterEqual
}