diff options
Diffstat (limited to 'lib/interpreter.ml')
-rw-r--r-- | lib/interpreter.ml | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/interpreter.ml b/lib/interpreter.ml index 346ceb5..7fc0413 100644 --- a/lib/interpreter.ml +++ b/lib/interpreter.ml @@ -5,7 +5,7 @@ Refer to the menhir manual in order to see the values. - The interresting function here is [of_lexer] which return the error code in + The interresting function here is [of_lexbuf] which return the error code in case of invalid syntax. *) @@ -17,7 +17,6 @@ struct code : error_code; start_pos : Lexing.position; end_pos : Lexing.position; - } module E = MenhirLib.ErrorReports @@ -31,6 +30,8 @@ struct let get_parse_error lexbuf env : error = match MI.stack env with | (lazy Nil) -> + (* The parser is in its initial state. We should not get an + error here *) let positions = Sedlexing.lexing_positions lexbuf in range_message positions InvalidSyntax | (lazy (Cons (MI.Element (state, _, start_pos, end_pos), _))) -> |