aboutsummaryrefslogtreecommitdiff
path: root/lib/checks/write_only.ml
diff options
context:
space:
mode:
Diffstat (limited to 'lib/checks/write_only.ml')
-rw-r--r--lib/checks/write_only.ml33
1 files changed, 24 insertions, 9 deletions
diff --git a/lib/checks/write_only.ml b/lib/checks/write_only.ml
index e2c3d7e..2d78b59 100644
--- a/lib/checks/write_only.ml
+++ b/lib/checks/write_only.ml
@@ -15,6 +15,9 @@ let description = "Check variables never read"
let active = ref false
let is_global = true
+let depends = []
+
+type ex = Qsp_syntax.Identifier.t
module StringMap = Hashtbl.Make (String)
module Set = Set.Make (String)
@@ -76,13 +79,16 @@ module Expression = struct
let default _ map = ignore map
end)
- let ident : (S.pos, t) S.variable -> t =
- fun variable filename map ->
+ let ident : ctx:Qsp_syntax.S.extract_context -> (S.pos, t) S.variable -> t =
+ fun ~ctx variable filename map ->
+ ignore ctx;
(* Update the map and set the read flag *)
set_readed variable.pos variable.name filename map
- let literal : S.pos -> t T.literal list -> t =
- fun pos l filename map ->
+ let literal :
+ ctx:Qsp_syntax.S.extract_context -> S.pos -> t T.literal list -> t =
+ fun ~ctx pos l filename map ->
+ ignore ctx;
List.iter l ~f:(function
| T.Text t ->
set_readed pos ~update_only:true (String.uppercase_ascii t) filename
@@ -91,13 +97,22 @@ module Expression = struct
(* When the string contains an expression evaluate it *)
exprs filename map)
- let function_ : S.pos -> T.function_ -> t list -> t =
- fun _ _ exprs filename map -> List.iter ~f:(fun v -> v filename map) exprs
+ let function_ :
+ ctx:Qsp_syntax.S.extract_context -> S.pos -> T.function_ -> t list -> t =
+ fun ~ctx _ _ exprs filename map ->
+ ignore ctx;
+ List.iter ~f:(fun v -> v filename map) exprs
- let uoperator : S.pos -> T.uoperator -> t -> t = fun _ _ t map -> t map
+ let uoperator :
+ ctx:Qsp_syntax.S.extract_context -> S.pos -> T.uoperator -> t -> t =
+ fun ~ctx _ _ t map ->
+ ignore ctx;
+ t map
- let boperator : S.pos -> T.boperator -> t -> t -> t =
- fun _ _ t1 t2 filename map ->
+ let boperator :
+ ctx:Qsp_syntax.S.extract_context -> S.pos -> T.boperator -> t -> t -> t =
+ fun ~ctx _ _ t1 t2 filename map ->
+ ignore ctx;
t1 filename map;
t2 filename map
end