feat: elaboration with empty tactic sequences #9524
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR changes the parsing of empty tactic sequences so that they report a parse error but still elaborate. For example, in
there are parse errors after each
=>
for not having complete tactic sequences, but both show the tactic state for that particular case. The syntaxes for many tactics have also been changed to require that the tactic sequence be strictly indented. The motivation for this is that, without strict indentation, the above example would parse with the secondcase
nested under the first one. Theinduction
andcases
tactics were modified in #7830 in anticipation of this change; one can writeinduction p with | _ x y
without the=>
if the succeeding tactics stay at the same indentation level.Implementation note: The orelse parser needed some additional logic to handle error recovery. Recall that in
p <|> q
, ifp
parses an antiquotation, thenq
is tentatively parsed as well to see if it parses a longer antiquotation. Now, ifq
does error recovery andp
parses an antiquotation,p
is preferred.Todo: add
else if
to theif
tactic.This works toward issue #3555. This PR is an experiment to see if having parse errors is more useful than distracting, given that they do not keep the tactic proof from elaborating.