summaryrefslogtreecommitdiff
path: root/parsing/parse.ml
diff options
context:
space:
mode:
Diffstat (limited to 'parsing/parse.ml')
-rw-r--r--parsing/parse.ml9
1 files changed, 5 insertions, 4 deletions
diff --git a/parsing/parse.ml b/parsing/parse.ml
index cf862af3f1..1fc61a6f4a 100644
--- a/parsing/parse.ml
+++ b/parsing/parse.ml
@@ -24,9 +24,9 @@ let rec skip_phrase lexbuf =
Parser.SEMISEMI | Parser.EOF -> ()
| _ -> skip_phrase lexbuf
with
- | Lexer.Error (Lexer.Unterminated_comment, _) -> ()
+ | Lexer.Error (Lexer.Unterminated_comment _, _) -> ()
| Lexer.Error (Lexer.Unterminated_string, _) -> ()
- | Lexer.Error (Lexer.Unterminated_string_in_comment, _) -> ()
+ | Lexer.Error (Lexer.Unterminated_string_in_comment _, _) -> ()
| Lexer.Error (Lexer.Illegal_character _, _) -> skip_phrase lexbuf
;;
@@ -38,13 +38,14 @@ let maybe_skip_phrase lexbuf =
let wrap parsing_fun lexbuf =
try
+ Lexer.init ();
let ast = parsing_fun Lexer.token lexbuf in
Parsing.clear_parser();
ast
with
- | Lexer.Error(Lexer.Unterminated_comment, _) as err -> raise err
+ | Lexer.Error(Lexer.Unterminated_comment _, _) as err -> raise err
| Lexer.Error(Lexer.Unterminated_string, _) as err -> raise err
- | Lexer.Error(Lexer.Unterminated_string_in_comment, _) as err -> raise err
+ | Lexer.Error(Lexer.Unterminated_string_in_comment _, _) as err -> raise err
| Lexer.Error(Lexer.Illegal_character _, _) as err ->
if !Location.input_name = "//toplevel//" then skip_phrase lexbuf;
raise err