mirror of
https://github.com/LucasVbr/croissant.git
synced 2026-07-09 06:57:48 +00:00
Feat: Add Character, String and float literals
This commit is contained in:
@@ -4,6 +4,7 @@ open BinaryOperators
|
||||
|
||||
type expressions =
|
||||
| Literal of literals
|
||||
| Identifier of string
|
||||
| UnaryExpression of unary_operators * expressions
|
||||
| BinaryExpression of binary_operators * expressions * expressions
|
||||
|
||||
@@ -11,6 +12,7 @@ let rec pp_expressions = function
|
||||
| Literal l ->
|
||||
let pp_l = pp_literals l in
|
||||
Printf.sprintf "Literal(%s)" pp_l
|
||||
| Identifier i -> Printf.sprintf "Identifier(\"%s\")" i
|
||||
| UnaryExpression (op, e) ->
|
||||
let pp_op = pp_unary_operators op and pp_e = pp_expressions e in
|
||||
Printf.sprintf "UnaryExpression(%s, %s)" pp_op pp_e
|
||||
|
||||
Reference in New Issue
Block a user