fix: export command for new frontend
This commit is contained in:
parent
cce9d57d5a
commit
8555cbaace
2 changed files with 4 additions and 3 deletions
|
|
@ -296,7 +296,8 @@ class MonadQuotation (m : Type → Type) :=
|
|||
transformer and not just a monadic action ensures that the current macro
|
||||
scope before the recursive call is restored after it, as expected. -/
|
||||
(withFreshMacroScope {α : Type} : m α → m α)
|
||||
export MonadQuotation
|
||||
|
||||
export MonadQuotation (getCurrMacroScope getMainModule withFreshMacroScope)
|
||||
|
||||
/-
|
||||
We represent a name with macro scopes as
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ let newAlts ← alts.mapSepElemsM fun alt => do
|
|||
let newHole ← `(?$holeName:ident)
|
||||
modify fun s => { s with nextIdx := s.nextIdx + 1}
|
||||
pure $ alt.setArg 2 newHole
|
||||
else MonadQuotation.withFreshMacroScope do -- TODO: why do we need MonadQuotation here
|
||||
else withFreshMacroScope do
|
||||
let newHole ← `(?rhs)
|
||||
let newHoleId := newHole.getArg 1
|
||||
let newCase ← `(tactic| case $newHoleId => $holeOrTacticSeq:tacticSeq )
|
||||
|
|
@ -39,7 +39,7 @@ let result := result.setArg 4 (matchAlts.setArg 1 (mkNullNode newAlts))
|
|||
pure result
|
||||
|
||||
private def mkAuxiliaryMatchTerm (parentTag : Name) (matchTac : Syntax) : MacroM (Syntax × Array Syntax) := do
|
||||
let (matchTerm, s) ← (mkAuxiliaryMatchTermAux parentTag matchTac).run {}
|
||||
let (matchTerm, s) ← mkAuxiliaryMatchTermAux parentTag matchTac $.run {}
|
||||
pure (matchTerm, s.cases)
|
||||
|
||||
@[builtinTactic Lean.Parser.Tactic.match] def evalMatch : Tactic :=
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue