22 lines
374 B
OCaml
22 lines
374 B
OCaml
|
|
type binary_opt =
|
|
| Add
|
|
| Subtract
|
|
| Multiply
|
|
| Divide
|
|
|
|
type expr =
|
|
| Let of { name: string; bindee: expr }
|
|
| Binary of { lhs: expr; rhs: expr; operator: binary_opt }
|
|
| IfElse of { condition: expr }
|
|
|
|
type builtin_type =
|
|
| I32
|
|
| F32
|
|
| Bool
|
|
| Char
|
|
|
|
module Examples = struct
|
|
let let_bind_int = "let x = 10"
|
|
let let_bind_str = "let s = \"hello\" "
|
|
end |