fix: expandMacroFns
We only keep trying other macros if the macro `m` produced `unsupportedSyntax`. If the macro produced an error, we keep the error. @Kha This should fix the web demo.
This commit is contained in:
parent
bc6dba89f3
commit
53dfd0d581
1 changed files with 7 additions and 1 deletions
|
|
@ -95,7 +95,13 @@ mkElabAttribute Macro `Lean.Elab.macroAttribute `builtinMacro `macro Name.anonym
|
|||
|
||||
private def expandMacroFns (stx : Syntax) : List Macro → MacroM Syntax
|
||||
| [] => throw Macro.Exception.unsupportedSyntax
|
||||
| m::ms => m stx <|> expandMacroFns ms
|
||||
| m::ms =>
|
||||
catch
|
||||
(m stx)
|
||||
(fun ex =>
|
||||
match ex with
|
||||
| Macro.Exception.unsupportedSyntax => expandMacroFns ms
|
||||
| ex => throw ex)
|
||||
|
||||
def getMacros (env : Environment) : Macro :=
|
||||
fun stx =>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue