fix: do not discard macro exceptions in expandMacro?

This commit is contained in:
Sebastian Ullrich 2022-05-30 13:28:42 +02:00
parent d3cf60e86a
commit ef9976ccda

View file

@ -153,8 +153,8 @@ def liftMacroM {α} {m : Type → Type} [Monad m] [MonadMacroAdapter m] [MonadEn
-- TODO: record recursive expansions in info tree?
expandMacro? := fun stx => do
match (← expandMacroImpl? env stx) with
| some (_, Except.ok stx) => return some stx
| _ => return none
| some (_, stx?) => liftExcept stx?
| none => return none
hasDecl := fun declName => return env.contains declName
getCurrNamespace := return currNamespace
resolveNamespace? := fun n => return ResolveName.resolveNamespace? env currNamespace openDecls n