aboutsummaryrefslogtreecommitdiff
path: root/lib/syntax/tree.ml
diff options
context:
space:
mode:
authorChimrod <>2025-07-19 11:18:24 +0200
committerChimrod <>2025-08-01 14:12:14 +0200
commit3046fb0d0c1ceac2c6a6ca9456e9e05671e0cef9 (patch)
tree8ba2700e541a6753499ceac54ced4f1d02a3b625 /lib/syntax/tree.ml
parent406b7b79cd375b071f92ddee9cee14a98dc91281 (diff)
Added dependencies system between the modules in the checksHEADmaster
Diffstat (limited to 'lib/syntax/tree.ml')
-rw-r--r--lib/syntax/tree.ml43
1 files changed, 29 insertions, 14 deletions
diff --git a/lib/syntax/tree.ml b/lib/syntax/tree.ml
index 0074df8..c3edcdc 100644
--- a/lib/syntax/tree.ml
+++ b/lib/syntax/tree.ml
@@ -7,9 +7,12 @@ let active = ref true
type context = unit
+let depends = []
let initialize = Fun.id
let finalize () = []
+type ex = Identifier.t
+
module Ast = struct
type 'a literal = 'a T.literal = Text of string | Expression of 'a
[@@deriving eq, show]
@@ -88,24 +91,36 @@ end = struct
Hashtbl.hash (f pos, name, List.map ~f:(hash f) args)
let v : t -> t' = fun t -> t
- let integer : S.pos -> string -> t = fun pos i -> Ast.Integer (pos, i)
-
- 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)
-
- let uoperator : S.pos -> T.uoperator -> t -> t =
- fun pos op expression -> Ast.Op (pos, op, expression)
- let boperator : S.pos -> T.boperator -> t -> t -> t =
- fun pos op op1 op2 ->
+ let integer : ctx:S.extract_context -> S.pos -> string -> t =
+ fun ~ctx pos i ->
+ ignore ctx;
+ Ast.Integer (pos, i)
+
+ let literal : ctx:S.extract_context -> S.pos -> t T.literal list -> t =
+ fun ~ctx pos l ->
+ ignore ctx;
+ Ast.Literal (pos, l)
+
+ let function_ : ctx:S.extract_context -> S.pos -> T.function_ -> t list -> t =
+ fun ~ctx pos name args ->
+ ignore ctx;
+ Ast.Function (pos, name, args)
+
+ let uoperator : ctx:S.extract_context -> S.pos -> T.uoperator -> t -> t =
+ fun ~ctx pos op expression ->
+ ignore ctx;
+ Ast.Op (pos, op, expression)
+
+ let boperator : ctx:S.extract_context -> S.pos -> T.boperator -> t -> t -> t =
+ fun ~ctx pos op op1 op2 ->
+ ignore ctx;
let op1 = op1 and op2 = op2 in
Ast.BinaryOp (pos, op, op1, op2)
- let ident : (S.pos, t) S.variable -> t =
- fun { pos; name; index } ->
+ let ident : ctx:S.extract_context -> (S.pos, t) S.variable -> t =
+ fun ~ctx { pos; name; index } ->
+ ignore ctx;
let index = Option.map (fun i -> i) index in
Ast.Ident { pos; name; index }
end