test: scoped parsers
This commit is contained in:
parent
c2cfbf2cdd
commit
54723409c3
1 changed files with 19 additions and 0 deletions
19
tests/lean/run/scopedParsers.lean
Normal file
19
tests/lean/run/scopedParsers.lean
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
def f (x y : Nat) := x + 2*y
|
||||
|
||||
namespace Foo
|
||||
|
||||
scoped infix:65 [1] "+" => f
|
||||
|
||||
theorem ex1 (x y : Nat) : x + y = f x y := rfl
|
||||
|
||||
#check 1 + 2
|
||||
|
||||
end Foo
|
||||
|
||||
#check 1 + 2
|
||||
theorem ex2 (x y : Nat) : x + y = HAdd.hAdd x y := rfl
|
||||
|
||||
open Foo
|
||||
|
||||
theorem ex3 (x y : Nat) : x + y = f x y := rfl
|
||||
#check 1 + 2
|
||||
Loading…
Add table
Reference in a new issue