Add initial typechecker for AST #2

Merged
mrab merged 121 commits from typedAST into master 2024-06-14 07:53:30 +00:00
2 changed files with 2 additions and 2 deletions
Showing only changes of commit e350c23db1 - Show all commits

View File

@ -30,7 +30,7 @@ data BinaryOperator
| Subtraction
| Multiplication
| Division
| Modulus
| Modulo
| BitwiseAnd
| BitwiseOr
| BitwiseXor

View File

@ -82,7 +82,7 @@ typeCheckExpression (BinaryOperation op expr1 expr2) symtab classes =
TypedExpression "int" (BinaryOperation op expr1' expr2')
else
error "Division operation requires two operands of type int"
Modulus ->
Modulo ->
if type1 == "int" && type2 == "int"
then
TypedExpression "int" (BinaryOperation op expr1' expr2')