mirror of
https://github.com/MorizzG/MLox.git
synced 2025-12-06 04:22:41 +00:00
implemented calls
This commit is contained in:
parent
8d445cc9e4
commit
be931b7214
6 changed files with 115 additions and 55 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue