refactor: Split ast into ast/syntax and ast/print

This commit is contained in:
Lucàs
2024-07-02 18:13:58 +02:00
parent 273bb2efe0
commit ce66b67cde
2 changed files with 25 additions and 11 deletions
+12
View File
@@ -0,0 +1,12 @@
(* lib/ast/syntax.ml *)
type binary_operator = Add | Substract | Multiply | Divide
type unary_operator = Negate
type expression =
| IntegerLiteral of int
| UnaryExpression of unary_operator * expression
| BinaryExpression of binary_operator * expression * expression
type statement = ExpressionStatement of expression
type source_file = SourceFile of statement list