Add error handling for Token_not_found
This commit is contained in:
parent
fd6bf1346e
commit
61b70f02f1
1 changed files with 1 additions and 0 deletions
1
main.ml
1
main.ml
|
@ -6,6 +6,7 @@ let version = "%%VERSION%%"
|
||||||
|
|
||||||
let error_to_string e =
|
let error_to_string e =
|
||||||
try raise e with
|
try raise e with
|
||||||
|
| Lex.Token_not_found -> sprintf "invalid token"
|
||||||
| Parser.Expected t -> sprintf "expected %s" t
|
| Parser.Expected t -> sprintf "expected %s" t
|
||||||
| Parser.Unexpected_token t -> sprintf "unexpected token \"%s\"" t
|
| Parser.Unexpected_token t -> sprintf "unexpected token \"%s\"" t
|
||||||
| Eval.Invalid_type -> "invalid type"
|
| Eval.Invalid_type -> "invalid type"
|
||||||
|
|
Loading…
Add table
Reference in a new issue