refactor: Syntax with unit tests

This commit is contained in:
Lucàs
2024-07-08 16:44:42 +02:00
parent 6df363c78d
commit 2e76ccf9fc
39 changed files with 460 additions and 771 deletions
+15
View File
@@ -0,0 +1,15 @@
type literals =
| Integer of int
| Float of float
| Character of char
| String of string
| Boolean of bool
| Null
let pp_literals = function
| Integer i -> Printf.sprintf "Integer(%d)" i
| Float f -> Printf.sprintf "Float(%f)" f
| Character c -> Printf.sprintf "Character('%c')" c
| String s -> Printf.sprintf "String(\"%s\")" s
| Boolean b -> Printf.sprintf "Boolean(%b)" b
| Null -> "Null"