handle Syntaxerr.Ill_formed_ast

This commit is contained in:
Jeremie Dimino 2014-08-18 11:29:34 +01:00
parent fac09516fc
commit 50a398744a
1 changed files with 3 additions and 0 deletions

View File

@ -256,6 +256,9 @@ let parse_default parse str eos_is_error =
| Syntaxerr.Not_expecting (loc, nonterm) -> | Syntaxerr.Not_expecting (loc, nonterm) ->
Error ([mkloc loc], Error ([mkloc loc],
Printf.sprintf "Syntax error: %s not expected" nonterm) Printf.sprintf "Syntax error: %s not expected" nonterm)
| Syntaxerr.Ill_formed_ast (loc, s) ->
Error ([mkloc loc],
Printf.sprintf "Error: broken invariant in parsetree: %s" s)
#endif #endif
end end
| Syntaxerr.Escape_error | Parsing.Parse_error -> | Syntaxerr.Escape_error | Parsing.Parse_error ->