mirror of
https://github.com/LucasVbr/croissant.git
synced 2026-05-14 01:22:06 +00:00
15 lines
416 B
OCaml
15 lines
416 B
OCaml
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" |