lean4-htt/tests/lean/interactive/incrementalTactic.lean

53 lines
1.2 KiB
Text
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/-! Basic incremental reuse in top-level tactic block -/
-- set_option trace.Elab.reuse true
def basic : True := by
dbg_trace "b 0"
apply id
dbg_trace "b 1"
apply id
dbg_trace "b 2"
--^ sync
--^ insert: ".5"
-- RESET
def trailingWhitespace : True := by
dbg_trace "t 0"
dbg_trace "t 1"
dbg_trace "t 2"
--^ sync
--^ insert: "\n "
-- RESET
-- this used to restore the wrong elab state because of input context mis-tracking
def haveBug : True := by
have (a : Nat) : Nat → True := by
intro n m
--^ sync
--^ delete: "intro n m"
--^ sync
--^ insert: "intro n m"
--^ collectDiagnostics
exact m
/-! incremental reporting should obey `showPartialSyntaxErrors` -/
-- RESET
def partialSyntax : True := by apply (
--^ collectDiagnostics
/-! A tactic block not supported by incrementality should not accidentally swallow messages. -/
-- RESET
def otherMessage : Nat × Nat where
fst := no
snd := by skip
--^ collectDiagnostics
/-! Starting to type a comment should not invalidate the state above it. -/
-- RESET
def strayToken : True := by
dbg_trace "s"
unfold f
--^ sync
--^ insert: " -"