2013-11-17 21:48:29 +00:00
|
|
|
local env = environment()
|
|
|
|
parse_lean_cmds([[
|
|
|
|
Variable N : Type
|
|
|
|
Variables x y : N
|
|
|
|
Variable f : N -> N -> N
|
2013-12-19 05:18:45 +00:00
|
|
|
SetOption pp::colors false
|
2013-11-17 21:48:29 +00:00
|
|
|
]], env)
|
|
|
|
local f, x, y = Consts("f, x, y")
|
|
|
|
print(env:check_type(f(x, y)))
|
|
|
|
assert(env:check_type(f(x, y)) == Const("N"))
|
|
|
|
assert(not get_options():get{"pp", "colors"})
|
|
|
|
parse_lean_cmds([[
|
2013-12-19 05:18:45 +00:00
|
|
|
SetOption pp::colors true
|
2013-11-17 21:48:29 +00:00
|
|
|
]], env)
|
|
|
|
assert(get_options():get{"pp", "colors"})
|
|
|
|
local o = get_options()
|
|
|
|
o:update({"lean", "pp", "notation"}, false)
|
|
|
|
assert(not o:get{"lean", "pp", "notation"})
|
|
|
|
o = parse_lean_cmds([[
|
|
|
|
Check fun x : N, y
|
2013-12-19 05:18:45 +00:00
|
|
|
SetOption pp::notation true
|
2013-11-17 21:48:29 +00:00
|
|
|
Check fun x : N, y
|
|
|
|
]], env, o)
|
|
|
|
print(o)
|
|
|
|
assert(o:get{"lean", "pp", "notation"})
|
|
|
|
assert(parse_lean("f x y", env) == f(x, y))
|