mirror of
https://github.com/LucasVbr/croissant.git
synced 2026-05-17 01:22:05 +00:00
refactor: Split ast into ast/syntax and ast/print
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user