lean2/tests/lua/coercion_bug1.lua
Leonardo de Moura 028a9bd9bd feat(frontends/lean/scanner): use Lua style comments in Lean
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-01-05 08:53:27 -08:00

23 lines
534 B
Lua

local env = environment()
env:import("Int")
parse_lean_cmds([[
Variable f : Int -> Int -> Int
Notation 20 _ +++ _ : f
Show f 10 20
Notation 20 _ -+- _ : f
Show f 10 20
]], env)
local F = parse_lean('f 10 20', env)
print(lean_formatter(env)(F))
assert(tostring(lean_formatter(env)(F)) == "10 -+- 20")
local child = env:mk_child()
parse_lean_cmds([[
Show f 10 20
]], child)
assert(tostring(lean_formatter(env)(F)) == "10 -+- 20")
print(lean_formatter(child)(F))
assert(tostring(lean_formatter(child)(F)) == "10 -+- 20")