Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion gramlib/grammar.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1320,11 +1320,15 @@ and parser_of_symbol : type s tr a.
let al =
try ps gstate strm__ :: al with
Stream.Failure ->
if not gstate.recover then raise Stream.Failure else
let bp = LStream.count strm__ in
let a =
try parse_top_symb entry symb gstate strm__ with
Stream.Failure ->
raise (Error (symb_failed entry v sep symb))
in
let ep = LStream.count strm__ in
let () = warn_recover_continuation bp ep strm__ in
a :: al
in
kont gstate al strm__
Expand All @@ -1344,11 +1348,16 @@ and parser_of_symbol : type s tr a.
with
Some al -> kont gstate al strm__
| _ ->
if not gstate.recover then al else
let bp = LStream.count strm__ in
match
try Some (parse_top_symb entry symb gstate strm__) with
Stream.Failure -> None
with
Some a -> kont gstate (a :: al) strm__
Some a ->
let ep = LStream.count strm__ in
let () = warn_recover_continuation bp ep strm__ in
kont gstate (a :: al) strm__
| _ -> al
end
| _ -> al
Expand Down