Commit 9c8cd47c authored by Raphaël Cauderlier's avatar Raphaël Cauderlier
Browse files

print_pos don't fail, calling exception is reraised instead

parent 57c909f3
......@@ -5,8 +5,7 @@ let print_pos lb =
let cnum = start.Lexing.pos_cnum - start.Lexing.pos_bol in
let tok = Lexing.lexeme lb in
Format.eprintf "File: %s, line: %d, column: %d, Token \"%s\"@\n@."
file line cnum tok;
exit 1
file line cnum tok
let rec lex_prog lb =
try
......@@ -14,8 +13,9 @@ let rec lex_prog lb =
let lines = lex_prog lb in
(pos, line) :: lines
with End_of_file -> []
| Parser.Error ->
print_pos lb
| e ->
print_pos lb;
raise e
let main () =
Arg.parse [] (fun file ->
......
Markdown is supported
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