diff options
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)  | 
