From 682a09b377ae85de6b59b481af4b7d0812f4b456 Mon Sep 17 00:00:00 2001 From: Chimrod <> Date: Mon, 24 Mar 2025 14:53:54 +0100 Subject: In case of identified error, leave the state properly at the end of the location --- lib/qparser/lexbuf.ml | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/qparser/lexbuf.ml') diff --git a/lib/qparser/lexbuf.ml b/lib/qparser/lexbuf.ml index dbed622..9ba7938 100644 --- a/lib/qparser/lexbuf.ml +++ b/lib/qparser/lexbuf.ml @@ -41,6 +41,7 @@ let pp_state format = function let state : t -> state option = fun t -> Stack.top_opt t.state let enter_state : t -> state -> unit = fun t state -> Stack.push state t.state let leave_state : t -> unit = fun t -> ignore @@ Stack.pop_opt t.state +let clear_state : t -> unit = fun t -> Stack.clear t.state let buffer : t -> Sedlexing.lexbuf = fun t -> t.buffer let start : t -> unit = @@ -92,6 +93,7 @@ let tokenize : (t -> 'a) -> t -> unit -> 'a * Lexing.position * Lexing.position let default, curr_p = positions t in let start_p = Option.value ~default t.start_p in + t.recovering <- false; t.start_p <- None; (token, start_p, curr_p) -- cgit v1.2.3