Commit 36931fd7 authored by POTTIER Francois's avatar POTTIER Francois
Browse files

Fixes in calc-inspection/, which for some reason did not

even compile.
parent c1af6807
......@@ -105,6 +105,10 @@ module E =
let terminal2token = terminal2token
let print_explanation explanation =
(* TEMPORARY not satisfactory at all *)
P.print_item explanation.MenhirLib.ErrorReporting.item
(* Initialize the lexer, and catch any exception raised by the lexer. *)
let process (line : string) =
......@@ -115,11 +119,13 @@ let process (line : string) =
| Lexer.Error msg ->
Printf.fprintf stderr "%s%!" msg
| E.Error explanations ->
| E.Error ((startp, _), explanations) ->
Printf.fprintf stderr
"At offset %d: syntax error.\n%!"
(Lexing.lexeme_start lexbuf);
List.iter P.print_item explanations
"At line %d, column %d: syntax error.\n"
List.iter print_explanation explanations;
flush stderr
(* The rest of the code is as in the [calc] demo. *)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment