gracefully ignore invalid input
This commit is contained in:
parent
486a788757
commit
7c4def6e1e
8
main.ml
8
main.ml
@ -54,6 +54,7 @@ let rec interactive ((g, gs) : proof) : proof =
|
|||||||
| Some g' -> print_goal g'
|
| Some g' -> print_goal g'
|
||||||
in
|
in
|
||||||
|
|
||||||
|
try
|
||||||
match parse_cmd (Lexing.from_string ((read_line ())^"\n")) with
|
match parse_cmd (Lexing.from_string ((read_line ())^"\n")) with
|
||||||
Goal ty -> fresh_proof ty |> interactive
|
Goal ty -> fresh_proof ty |> interactive
|
||||||
| Tact t ->
|
| Tact t ->
|
||||||
@ -71,6 +72,13 @@ let rec interactive ((g, gs) : proof) : proof =
|
|||||||
| Apply id ->
|
| Apply id ->
|
||||||
tact_apply (g, gs) id |> interactive
|
tact_apply (g, gs) id |> interactive
|
||||||
end
|
end
|
||||||
|
with
|
||||||
|
Parser.Error ->
|
||||||
|
print_string "Invalid input.\n";
|
||||||
|
interactive (g, gs)
|
||||||
|
| End_of_file ->
|
||||||
|
print_string "Bye!\n";
|
||||||
|
(g, gs)
|
||||||
end
|
end
|
||||||
|
|
||||||
let interpret e =
|
let interpret e =
|
||||||
|
Loading…
Reference in New Issue
Block a user