lean4-htt/tests/lean/run/extmacro.lean
Leonardo de Moura ffefd8db36 chore: remove weird syntax sugar from macro command
Before this commit,
```
macro term x:term : term => `($x)
```
would generate the notation
```
syntax "term" term : term
```
2020-12-10 08:09:47 -08:00

19 lines
458 B
Text

macro "ext_tactic" t:tactic "=>" newT:tactic : command => `(macro_rules | `($t) => `($newT))
syntax "trivial" : tactic
ext_tactic trivial => apply Eq.refl
theorem tst1 (x : Nat) : x = x :=
by trivial
-- theorem tst2 (x y : Nat) (h : x = y) : x = y :=
-- by trivial -- fail as expected
ext_tactic trivial => assumption
theorem tst1b (x : Nat) : x = x :=
by trivial -- still works
theorem tst2 (x y : Nat) (h : x = y) : x = y :=
by trivial -- works too