lean4-htt/tests/lean/macroElabRulesIssue1.lean
Leonardo de Moura 3846dd60fd fix: evalTactic
This commit fixes bug reported by Patrick Massot.
It happened when using `macro_rules` and `elab_rules` for the same
`SyntaxNodeKind`.

It also fixes missing error messages when there is more than one
elaboration functions and there is `abortTactic` exception.

Remark: this commit also changes the evaluation order. Macros are
now tried before elaboration rules. The motivation is that macros are
already applied before elaboration functions in the term elaborator.
2022-07-19 23:28:14 -04:00

16 lines
275 B
Text

import Lean
open Lean Elab Tactic
syntax "Foo" (ident <|> num) : tactic
elab_rules : tactic
| `(tactic| Foo $x:num) =>
logInfo "num"
macro_rules
| `(tactic| Foo $x:ident) => `(tactic| trace "ident")
example : True := by
Foo x -- should not fail
trivial