chore: add Elab.command trace class

This commit is contained in:
Leonardo de Moura 2020-10-18 16:33:42 -07:00
parent 5402ea88a2
commit 9d36d91b84
2 changed files with 6 additions and 12 deletions

View file

@ -182,6 +182,8 @@ catch ex => match ex with
let idName ← liftIO $ id.getName;
logError msg!"internal exception {idName}"
initialize registerTraceClass `Elab.command
partial def elabCommand : Syntax → CommandElabM Unit
| stx => withLogging $ withRef stx $ withIncRecDepth $ withFreshMacroScope $ match stx with
| Syntax.node k args =>
@ -190,7 +192,7 @@ partial def elabCommand : Syntax → CommandElabM Unit
-- The parser will only ever return a single command at a time, but syntax quotations can return multiple ones
args.forM elabCommand
else do
trace `Elab.step fun _ => stx;
trace `Elab.command fun _ => stx;
let s ← get
let stxNew? ← catchInternalId unsupportedSyntaxExceptionId
(do let newStx ← adaptMacro (getMacros s.env) stx; pure (some newStx))

View file

@ -1,21 +1,13 @@
[Elab.step] #check fun x => m x
fun (x : ?m) (x_1 : ?m x) => x : (x : ?m) → ?m x → ?m
[Elab.step] expected type: <not-available>, term
fun x => m x
[Elab.step]
[Elab.step] expected type: Sort _, term
[Elab.step] expected type: Sort _, term
_
[Elab.step]
[Elab.step] expected type: <not-available>, term
m x
[Elab.step]
[Elab.step] expected type: <not-available>, term
[Elab.step] expected type: <not-available>, term
fun x✝ => x
[Elab.step]
[Elab.step] expected type: Sort _, term
[Elab.step] expected type: Sort _, term
_
[Elab.step]
[Elab.step] expected type: <not-available>, term
x
[Elab.step]
[Elab.step] end