diff options
Diffstat (limited to 'lib/interpreter.ml')
-rw-r--r-- | lib/interpreter.ml | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/lib/interpreter.ml b/lib/interpreter.ml index 21c1430..346ceb5 100644 --- a/lib/interpreter.ml +++ b/lib/interpreter.ml @@ -11,20 +11,22 @@ type error_code = InvalidSyntax | MenhirCode of int -type error = { - code : error_code; - start_pos : Lexing.position; - end_pos : Lexing.position; -} - module Interpreter (MI : MenhirLib.IncrementalEngine.INCREMENTAL_ENGINE) = struct + type error = { + code : error_code; + start_pos : Lexing.position; + end_pos : Lexing.position; + + } + module E = MenhirLib.ErrorReports module L = MenhirLib.LexerUtil type step = MI.token * Lexing.position * Lexing.position - let range_message (start_pos, end_pos) code = { code; start_pos; end_pos } + let range_message (start_pos, end_pos) : error_code -> error = + fun code -> { code; start_pos; end_pos } let get_parse_error lexbuf env : error = match MI.stack env with |