From 6ada3862d96f82e44b3b19dd84d08cbb8c6a6006 Mon Sep 17 00:00:00 2001
From: Chimrod <>
Date: Sat, 4 Nov 2023 17:16:16 +0100
Subject: Allow test to be enabled or disabled by command line

---
 lib/syntax/S.ml              | 6 ++++++
 lib/syntax/check.ml          | 1 +
 lib/syntax/dead_end.ml       | 1 +
 lib/syntax/nested_strings.ml | 1 +
 lib/syntax/tree.ml           | 1 +
 lib/syntax/type_of.ml        | 1 +
 6 files changed, 11 insertions(+)

(limited to 'lib/syntax')

diff --git a/lib/syntax/S.ml b/lib/syntax/S.ml
index a961738..afb6526 100644
--- a/lib/syntax/S.ml
+++ b/lib/syntax/S.ml
@@ -104,7 +104,13 @@ end
 
 module type Analyzer = sig
   val identifier : string
+  (** Identifier for the module *)
+
   val description : string
+  (** Short description*)
+
+  val active : bool ref
+  (** Is the test active or not *)
 
   module Expression : Expression
   module Instruction : Instruction with type expression = Expression.t'
diff --git a/lib/syntax/check.ml b/lib/syntax/check.ml
index 59eaaf1..c5dfe74 100644
--- a/lib/syntax/check.ml
+++ b/lib/syntax/check.ml
@@ -110,6 +110,7 @@ end
 module Make (A : App) = struct
   let identifier = "main_checker"
   let description = "Internal module"
+  let active = ref false
 
   (* Global variable for the whole module *)
   let len = Array.length A.t
diff --git a/lib/syntax/dead_end.ml b/lib/syntax/dead_end.ml
index bb56b2f..98c361e 100644
--- a/lib/syntax/dead_end.ml
+++ b/lib/syntax/dead_end.ml
@@ -2,6 +2,7 @@ open StdLabels
 
 let identifier = "dead_end"
 let description = "Check for dead end in the code"
+let active = ref false
 
 module Expression = struct
   type t = unit
diff --git a/lib/syntax/nested_strings.ml b/lib/syntax/nested_strings.ml
index 37f352c..16ec4ac 100644
--- a/lib/syntax/nested_strings.ml
+++ b/lib/syntax/nested_strings.ml
@@ -2,6 +2,7 @@ open StdLabels
 
 let identifier = "escaped_string"
 let description = "Check for unnecessary use of expression encoded in string"
+let active = ref true
 
 module Expression : S.Expression with type t' = Report.t list = struct
   type t = Report.t list
diff --git a/lib/syntax/tree.ml b/lib/syntax/tree.ml
index 8444fd9..6f99bbd 100644
--- a/lib/syntax/tree.ml
+++ b/lib/syntax/tree.ml
@@ -2,6 +2,7 @@ open StdLabels
 
 let identifier = "tree"
 let description = "Build the AST"
+let active = ref true
 
 module Ast = struct
   type 'a literal = 'a T.literal = Text of string | Expression of 'a list
diff --git a/lib/syntax/type_of.ml b/lib/syntax/type_of.ml
index 224e029..223633c 100644
--- a/lib/syntax/type_of.ml
+++ b/lib/syntax/type_of.ml
@@ -2,6 +2,7 @@ open StdLabels
 
 let identifier = "type_check"
 let description = "Ensure all the expression are correctly typed"
+let active = ref true
 
 module Helper = struct
   type type_of =
-- 
cgit v1.2.3