feat: dbg_trace tactic for low-level tactic debugging

This commit is contained in:
Leonardo de Moura 2022-03-19 08:25:49 -07:00
parent 9727387129
commit bd7827ed04
2 changed files with 7 additions and 0 deletions

View file

@ -437,6 +437,8 @@ syntax "trivial" : tactic
syntax (name := split) "split " (colGt term)? (location)? : tactic
syntax (name := dbgTrace) "dbg_trace " str : tactic
/--
The tactic `specialize h a₁ ... aₙ` works on local hypothesis `h`.
The premises of this hypothesis, either universal quantifications or non-dependent implications,

View file

@ -291,4 +291,9 @@ where
| some msg => throwError "{msg}\n{goalsMsg}"
| _ => throwUnsupportedSyntax
@[tactic dbgTrace] def evalDbgTrace : Tactic := fun stx => do
match stx[1].isStrLit? with
| none => throwIllFormedSyntax
| some msg => dbg_trace msg
end Lean.Elab.Tactic