mirror of
https://github.com/ProgramSnail/Lama.git
synced 2025-12-27 00:58:47 +00:00
Even better error reporting
This commit is contained in:
parent
b6180d8634
commit
92f60665df
3 changed files with 56 additions and 44 deletions
|
|
@ -109,7 +109,7 @@ class options args =
|
|||
end
|
||||
|
||||
let main =
|
||||
(* try*)
|
||||
try
|
||||
let cmd = new options Sys.argv in
|
||||
match (try parse cmd with Language.Semantic_error msg -> `Fail msg) with
|
||||
| `Ok prog ->
|
||||
|
|
@ -136,6 +136,5 @@ let main =
|
|||
List.iter (fun i -> Printf.printf "%d\n" i) output
|
||||
)
|
||||
| `Fail er -> Printf.eprintf "Error: %s\n" er
|
||||
(* with Invalid_argument _ ->
|
||||
Printf.printf "Usage: rc [-i | -s] <input file.expr>\n"
|
||||
*)
|
||||
with Language.Semantic_error msg -> Printf.printf "Error: %s\n" msg
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue