diff options
author | Chimrod <> | 2025-03-24 14:53:54 +0100 |
---|---|---|
committer | Chimrod <> | 2025-03-24 14:53:54 +0100 |
commit | 682a09b377ae85de6b59b481af4b7d0812f4b456 (patch) | |
tree | da627b5ab15bd9b72200c96638aee2ef31c5aa98 /lib/qparser/lexbuf.ml | |
parent | 23bcff2eaf5938acc04507636698c034c4767a1e (diff) |
In case of identified error, leave the state properly at the end of the location
Diffstat (limited to 'lib/qparser/lexbuf.ml')
-rw-r--r-- | lib/qparser/lexbuf.ml | 2 |
1 files changed, 2 insertions, 0 deletions
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) |