implemented calls

This commit is contained in:
Moritz Gmeiner 2024-08-27 20:32:05 +02:00
commit be931b7214
6 changed files with 115 additions and 55 deletions

View file

@ -48,13 +48,13 @@ let print_error (e : lox_error) =
| LexerError es ->
let num_errors = List.length es in
assert (num_errors <> 0);
Printf.fprintf stderr "found %d %s:\n" num_errors
Printf.eprintf "found %d %s:\n%!" num_errors
(if num_errors = 1 then "LexerError" else "LexerErrors");
List.iter (fun e -> LexerError.show e |> prerr_endline) es
| ParserError es ->
let num_errors = List.length es in
assert (num_errors <> 0);
Printf.fprintf stderr "found %d %s:\n" num_errors
Printf.eprintf "found %d %s:\n%!" num_errors
(if num_errors = 1 then "ParserError" else "ParserErrors");
List.iter (fun e -> ParserError.show e |> prerr_endline) es
| RuntimeError e -> RuntimeError.show e |> prerr_endline