Capitalize error messages
This commit is contained in:
parent
af7799ea2c
commit
76bc20c434
1 changed files with 3 additions and 2 deletions
5
main.ml
5
main.ml
|
@ -21,11 +21,12 @@ let () =
|
||||||
let parsed = Parser.prog Lexer.token buf in
|
let parsed = Parser.prog Lexer.token buf in
|
||||||
close_in f;
|
close_in f;
|
||||||
let ast = Semantics.analyze parsed in
|
let ast = Semantics.analyze parsed in
|
||||||
|
(* Semantics.emit Stdlib.stderr ast; *)
|
||||||
let asm = Compiler.compile ast in
|
let asm = Compiler.compile ast in
|
||||||
Mips.emit Stdlib.stdout asm
|
Mips.emit Stdlib.stdout asm
|
||||||
with
|
with
|
||||||
| Lexer.Error c ->
|
| Lexer.Error c ->
|
||||||
err (Printf.sprintf "unrecognized char '%c'" c) (Lexing.lexeme_start_p buf)
|
err (Printf.sprintf "Unrecognized char \"%c\"" c) (Lexing.lexeme_start_p buf)
|
||||||
| Parser.Error -> err "syntax error" (Lexing.lexeme_start_p buf)
|
| Parser.Error -> err "Syntax error" (Lexing.lexeme_start_p buf)
|
||||||
| Semantics.Error (msg, pos) -> err msg pos
|
| Semantics.Error (msg, pos) -> err msg pos
|
||||||
;;
|
;;
|
||||||
|
|
Reference in a new issue