aboutsummaryrefslogtreecommitdiff
path: root/test/syntax.ml
diff options
context:
space:
mode:
authorChimrod <>2024-02-05 09:32:10 +0100
committerChimrod <>2024-02-08 14:16:41 +0100
commit916d37b93c8ad0e2fbe98377093726baf051b708 (patch)
treee8c6b77368fb8971af11a425ac61e0b3e2014beb /test/syntax.ml
parentd7a13b0e5d6e746993e67a291376bd79766e0ed1 (diff)
Ignore the global checkers if there is a syntax error; ignore error during recovery after a syntax error
Diffstat (limited to 'test/syntax.ml')
-rw-r--r--test/syntax.ml5
1 files changed, 3 insertions, 2 deletions
diff --git a/test/syntax.ml b/test/syntax.ml
index 87fe2ab..aa3eecb 100644
--- a/test/syntax.ml
+++ b/test/syntax.ml
@@ -29,10 +29,11 @@ let parse : string -> (S.pos location, Qsp_syntax.Report.t) result =
in
let context = Parser.initialize () in
Qparser.Analyzer.parse (module Parser) lexing context
- |> Result.map (fun (location, _report) ->
+ |> Result.map (fun v ->
(* Uncatched excteptions here, but we are in the tests…
If it’s fail here I have an error in the code. *)
- Array.get location 0 |> Check.get location_id |> Option.get)
+ Array.get v.Qparser.Analyzer.content 0
+ |> Check.get location_id |> Option.get)
let location : S.pos location Alcotest.testable =
let equal = equal_location (fun _ _ -> true) in