blob: 53b882291a7d80933e8e171ccfa40a9732548591 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
--- a/src/lib/otoml_base.ml
+++ b/src/lib/otoml_base.ml
@@ -595,9 +595,9 @@
module MI = Toml_parser.MenhirInterpreter
let get_parse_error env =
- match MI.stack env with
- | lazy Nil -> "Invalid syntax"
- | lazy (Cons (MI.Element (state, _, _, _), _)) ->
+ match MI.top env with
+ | None -> "Invalid syntax"
+ | Some (MI.Element (state, _, _, _)) ->
try (String.trim (Toml_parser_messages.message (MI.number state))) with
| Not_found -> "invalid syntax (no specific message for this error)"
|