This PR adds the necessary infrastructure for recording elaboration dependencies that may not be apparent from the resulting environment such as notations and other metaprograms. An adapted version of `shake` from Mathlib is added to `script/` but may be moved to another location or repo in the future.
20 lines
422 B
Text
20 lines
422 B
Text
module
|
||
import all Init.Prelude
|
||
|
||
open Lean
|
||
def exec (x : MacroM α) : Option α :=
|
||
match x {
|
||
quotContext := `Expander
|
||
currMacroScope := 0
|
||
ref := default
|
||
methods := default } { macroScope := 0 } with
|
||
| EStateM.Result.ok a s => a
|
||
| _ => none
|
||
|
||
def tst : MacroM String := do
|
||
let n ← Macro.getCurrNamespace
|
||
return toString n
|
||
|
||
/-- info: some "[anonymous]" -/
|
||
#guard_msgs in
|
||
#eval exec tst
|