From 916d37b93c8ad0e2fbe98377093726baf051b708 Mon Sep 17 00:00:00 2001 From: Chimrod <> Date: Mon, 5 Feb 2024 09:32:10 +0100 Subject: Ignore the global checkers if there is a syntax error; ignore error during recovery after a syntax error --- test/syntax.ml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'test/syntax.ml') 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 -- cgit v1.2.3