Add error handling for Token_not_found

This commit is contained in:
백현웅 2022-01-17 15:21:47 +09:00
parent fd6bf1346e
commit 61b70f02f1

View file

@ -6,6 +6,7 @@ let version = "%%VERSION%%"
let error_to_string e =
try raise e with
| Lex.Token_not_found -> sprintf "invalid token"
| Parser.Expected t -> sprintf "expected %s" t
| Parser.Unexpected_token t -> sprintf "unexpected token \"%s\"" t
| Eval.Invalid_type -> "invalid type"