aboutsummaryrefslogtreecommitdiff
path: root/lib/syntax/default.ml
diff options
context:
space:
mode:
authorChimrod <>2023-10-16 16:42:53 +0200
committerChimrod <>2023-10-18 11:19:35 +0200
commit0b75cd5bc0f7d0ad905bce5bebc6e47c927f64d7 (patch)
tree9381b4b3b6c06104d773978f330f073b805a40f0 /lib/syntax/default.ml
parent736456d9952c1d58008f4ca5755913dfff7a32b8 (diff)
Used the dead-end checker in main analysis
Diffstat (limited to 'lib/syntax/default.ml')
-rw-r--r--lib/syntax/default.ml35
1 files changed, 21 insertions, 14 deletions
diff --git a/lib/syntax/default.ml b/lib/syntax/default.ml
index eed7f2b..dad5144 100644
--- a/lib/syntax/default.ml
+++ b/lib/syntax/default.ml
@@ -3,7 +3,13 @@
This module is expected to be used when you only need to implement an analyze
over a limited part of the whole syntax. *)
-module Expression = struct
+module type T = sig
+ type t
+
+ val default : t
+end
+
+module Expression (T' : T) = struct
(**
Describe a variable, using the name in capitalized text, and an optionnal
index.
@@ -11,28 +17,29 @@ module Expression = struct
If missing, the index should be considered as [0].
*)
- type t = unit
- type t' = unit
-
- let ident : (S.pos, t S.repr) S.variable -> t S.repr =
- fun _ report -> ((), report)
+ let ident : (S.pos, T'.t S.repr) S.variable -> T'.t S.repr =
+ fun _ report -> (T'.default, report)
(*
Basic values, text, number…
*)
- let integer : S.pos -> string -> t S.repr = fun _ _ report -> ((), report)
- let literal : S.pos -> string -> t S.repr = fun _ _ report -> ((), report)
+ let integer : S.pos -> string -> T'.t S.repr =
+ fun _ _ report -> (T'.default, report)
+
+ let literal : S.pos -> string -> T'.t S.repr =
+ fun _ _ report -> (T'.default, report)
(** Call a function. The functions list is hardcoded in lib/lexer.mll *)
- let function_ : S.pos -> T.function_ -> t S.repr list -> t S.repr =
- fun _ _ _ report -> ((), report)
+ let function_ : S.pos -> T.function_ -> T'.t S.repr list -> T'.t S.repr =
+ fun _ _ _ report -> (T'.default, report)
(** Unary operator like [-123] or [+'Text']*)
- let uoperator : S.pos -> T.uoperator -> t S.repr -> t S.repr =
- fun _ _ _ report -> ((), report)
+ let uoperator : S.pos -> T.uoperator -> T'.t S.repr -> T'.t S.repr =
+ fun _ _ _ report -> (T'.default, report)
(** Binary operator, for a comparaison, or an operation *)
- let boperator : S.pos -> T.boperator -> t S.repr -> t S.repr -> t S.repr =
- fun _ _ _ _ report -> ((), report)
+ let boperator :
+ S.pos -> T.boperator -> T'.t S.repr -> T'.t S.repr -> T'.t S.repr =
+ fun _ _ _ _ report -> (T'.default, report)
end