aboutsummaryrefslogtreecommitdiff
path: root/lib/syntax
diff options
context:
space:
mode:
Diffstat (limited to 'lib/syntax')
-rw-r--r--lib/syntax/S.ml3
-rw-r--r--lib/syntax/check.ml6
-rw-r--r--lib/syntax/check.mli2
-rw-r--r--lib/syntax/dead_end.ml3
-rw-r--r--lib/syntax/nested_strings.ml3
-rw-r--r--lib/syntax/tree.ml3
-rw-r--r--lib/syntax/type_of.ml3
7 files changed, 23 insertions, 0 deletions
diff --git a/lib/syntax/S.ml b/lib/syntax/S.ml
index 972e405..a961738 100644
--- a/lib/syntax/S.ml
+++ b/lib/syntax/S.ml
@@ -103,6 +103,9 @@ end
(** {1 Unified module used by the parser } *)
module type Analyzer = sig
+ val identifier : string
+ val description : string
+
module Expression : Expression
module Instruction : Instruction with type expression = Expression.t'
module Location : Location with type instruction = Instruction.t'
diff --git a/lib/syntax/check.ml b/lib/syntax/check.ml
index a7095fc..59eaaf1 100644
--- a/lib/syntax/check.ml
+++ b/lib/syntax/check.ml
@@ -83,6 +83,9 @@ let build :
in
(location_witness, t)
+let get_module : t -> (module S.Analyzer) =
+ fun (E { module_; _ }) -> (module_ :> (module S.Analyzer))
+
module type App = sig
val t : t array
end
@@ -105,6 +108,9 @@ module Helper = struct
end
module Make (A : App) = struct
+ let identifier = "main_checker"
+ let description = "Internal module"
+
(* Global variable for the whole module *)
let len = Array.length A.t
diff --git a/lib/syntax/check.mli b/lib/syntax/check.mli
index 759a07a..daacf47 100644
--- a/lib/syntax/check.mli
+++ b/lib/syntax/check.mli
@@ -35,6 +35,8 @@ val build :
Return the result type which hold the final result value, and checker
itself. *)
+val get_module : t -> (module S.Analyzer)
+
type result
val get : 'a Id.typeid -> result -> 'a option
diff --git a/lib/syntax/dead_end.ml b/lib/syntax/dead_end.ml
index 042e640..bb56b2f 100644
--- a/lib/syntax/dead_end.ml
+++ b/lib/syntax/dead_end.ml
@@ -1,5 +1,8 @@
open StdLabels
+let identifier = "dead_end"
+let description = "Check for dead end in the code"
+
module Expression = struct
type t = unit
type t' = unit
diff --git a/lib/syntax/nested_strings.ml b/lib/syntax/nested_strings.ml
index 9d4867c..37f352c 100644
--- a/lib/syntax/nested_strings.ml
+++ b/lib/syntax/nested_strings.ml
@@ -1,5 +1,8 @@
open StdLabels
+let identifier = "escaped_string"
+let description = "Check for unnecessary use of expression encoded in string"
+
module Expression : S.Expression with type t' = Report.t list = struct
type t = Report.t list
type t' = t
diff --git a/lib/syntax/tree.ml b/lib/syntax/tree.ml
index e70b66a..8444fd9 100644
--- a/lib/syntax/tree.ml
+++ b/lib/syntax/tree.ml
@@ -1,5 +1,8 @@
open StdLabels
+let identifier = "tree"
+let description = "Build the AST"
+
module Ast = struct
type 'a literal = 'a T.literal = Text of string | Expression of 'a list
[@@deriving eq, show]
diff --git a/lib/syntax/type_of.ml b/lib/syntax/type_of.ml
index 8f1c7ef..224e029 100644
--- a/lib/syntax/type_of.ml
+++ b/lib/syntax/type_of.ml
@@ -1,5 +1,8 @@
open StdLabels
+let identifier = "type_check"
+let description = "Ensure all the expression are correctly typed"
+
module Helper = struct
type type_of =
| Integer (** A numeric value *)