2013-12-09 01:46:56 +00:00
|
|
|
local env = environment()
|
2014-01-01 21:52:25 +00:00
|
|
|
env:import("Int")
|
2013-12-09 01:46:56 +00:00
|
|
|
parse_lean_cmds([[
|
2014-01-05 20:05:08 +00:00
|
|
|
variable f : Int -> Int -> Int
|
|
|
|
notation 20 _ +++ _ : f
|
2014-01-05 19:03:35 +00:00
|
|
|
print f 10 20
|
2014-01-05 20:05:08 +00:00
|
|
|
notation 20 _ -+- _ : f
|
2014-01-05 19:03:35 +00:00
|
|
|
print f 10 20
|
2013-12-09 01:46:56 +00:00
|
|
|
]], env)
|
|
|
|
|
|
|
|
local F = parse_lean('f 10 20', env)
|
|
|
|
print(lean_formatter(env)(F))
|
2014-01-05 16:52:46 +00:00
|
|
|
assert(tostring(lean_formatter(env)(F)) == "10 -+- 20")
|
2013-12-09 01:46:56 +00:00
|
|
|
|
|
|
|
local child = env:mk_child()
|
|
|
|
|
|
|
|
parse_lean_cmds([[
|
2014-01-05 19:03:35 +00:00
|
|
|
print f 10 20
|
2013-12-09 01:46:56 +00:00
|
|
|
]], child)
|
|
|
|
|
2014-01-05 16:52:46 +00:00
|
|
|
assert(tostring(lean_formatter(env)(F)) == "10 -+- 20")
|
2013-12-09 01:46:56 +00:00
|
|
|
print(lean_formatter(child)(F))
|
2014-01-05 16:52:46 +00:00
|
|
|
assert(tostring(lean_formatter(child)(F)) == "10 -+- 20")
|