fix: induction pre-tactic should be indented (#5494)

Fixes #2876
This commit is contained in:
Sebastian Ullrich 2024-09-27 14:43:42 +02:00 committed by GitHub
parent 48711ce6eb
commit e7691f37c6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 9 additions and 1 deletions

View file

@ -788,7 +788,7 @@ syntax inductionAlt := ppDedent(ppLine) inductionAltLHS+ " => " (hole <|> synth
After `with`, there is an optional tactic that runs on all branches, and
then a list of alternatives.
-/
syntax inductionAlts := " with" (ppSpace tactic)? withPosition((colGe inductionAlt)+)
syntax inductionAlts := " with" (ppSpace colGt tactic)? withPosition((colGe inductionAlt)+)
/--
Assuming `x` is a variable in the local context with an inductive type,

View file

@ -0,0 +1,5 @@
/-! should not parse `done` as part of `induction` -/
example (a : Nat) : True := by
induction a with
done

View file

@ -0,0 +1 @@
inductionParse.lean:4:18-5:6: error: unexpected identifier; expected '|'

View file

@ -1,3 +1,5 @@
/-! should not parse `case` as a `generalizing` variable -/
example (a b : Nat) : True := by
induction a generalizing b
case zero => trivial