diff options
author | Chimrod <> | 2023-10-28 22:17:24 +0200 |
---|---|---|
committer | Chimrod <> | 2023-11-02 11:06:12 +0100 |
commit | 77ae152ece4efbf8dde983c03bd995c982522bfd (patch) | |
tree | b6427477b66042f766e58148441166b83984ddbb /lib/syntax/tree.ml | |
parent | dd060261e35fcb8a57f03b01dbe84ab772a2a199 (diff) |
Updated the interface
Diffstat (limited to 'lib/syntax/tree.ml')
-rw-r--r-- | lib/syntax/tree.ml | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/syntax/tree.ml b/lib/syntax/tree.ml index d4af905..34baae0 100644 --- a/lib/syntax/tree.ml +++ b/lib/syntax/tree.ml @@ -1,12 +1,15 @@ open StdLabels module Ast = struct + type 'a literal = 'a T.literal = Text of string | Expression of 'a list + [@@deriving eq, show] + type 'a variable = { pos : 'a; name : string; index : 'a expression option } [@@deriving eq, show] and 'a expression = | Integer of 'a * string - | Literal of 'a * string + | Literal of 'a * 'a expression literal list | Ident of 'a variable | BinaryOp of 'a * T.boperator * 'a expression * 'a expression | Op of 'a * T.uoperator * 'a expression @@ -38,7 +41,9 @@ module Expression : S.Expression with type t' = S.pos Ast.expression = struct let v : t -> t' = fun t -> t let integer : S.pos -> string -> t = fun pos i -> Ast.Integer (pos, i) - let literal : S.pos -> string -> t = fun pos l -> Ast.Literal (pos, l) + + let literal : S.pos -> t T.literal list -> t = + fun pos l -> Ast.Literal (pos, l) let function_ : S.pos -> T.function_ -> t list -> t = fun pos name args -> Ast.Function (pos, name, args) |