chore(kernel): fix style and lua bindings
This commit is contained in:
parent
ea1bae0143
commit
243f80231a
3 changed files with 3 additions and 2 deletions
|
@ -29,7 +29,7 @@ class type_checker;
|
||||||
class environment;
|
class environment;
|
||||||
class certified_declaration;
|
class certified_declaration;
|
||||||
|
|
||||||
typedef std::function<bool(name const &)> extra_opaque_pred;
|
typedef std::function<bool(name const &)> extra_opaque_pred; // NOLINT
|
||||||
extra_opaque_pred const & no_extra_opaque();
|
extra_opaque_pred const & no_extra_opaque();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1842,8 +1842,8 @@ static int mk_type_checker(lua_State * L) {
|
||||||
return push_type_checker_ref(L, std::make_shared<type_checker>(to_environment(L, 1), to_name_generator(L, 2)));
|
return push_type_checker_ref(L, std::make_shared<type_checker>(to_environment(L, 1), to_name_generator(L, 2)));
|
||||||
} else {
|
} else {
|
||||||
optional<module_idx> mod_idx; bool memoize; name_set extra_opaque;
|
optional<module_idx> mod_idx; bool memoize; name_set extra_opaque;
|
||||||
extra_opaque_pred pred([=](name const & n) { return extra_opaque.contains(n); });
|
|
||||||
get_type_checker_args(L, 3, mod_idx, memoize, extra_opaque);
|
get_type_checker_args(L, 3, mod_idx, memoize, extra_opaque);
|
||||||
|
extra_opaque_pred pred([=](name const & n) { return extra_opaque.contains(n); });
|
||||||
auto t = std::make_shared<type_checker>(to_environment(L, 1), to_name_generator(L, 2),
|
auto t = std::make_shared<type_checker>(to_environment(L, 1), to_name_generator(L, 2),
|
||||||
mk_default_converter(to_environment(L, 1), mod_idx, memoize, pred),
|
mk_default_converter(to_environment(L, 1), mod_idx, memoize, pred),
|
||||||
memoize);
|
memoize);
|
||||||
|
|
|
@ -56,5 +56,6 @@ assert(not pcall(function() print(tc2:check(id_1(Type, a))) end))
|
||||||
assert(tc2:whnf(id_2(Type, a)) == a)
|
assert(tc2:whnf(id_2(Type, a)) == a)
|
||||||
assert(tc2:whnf(id_2(Type, id_2(Type, a))) == a)
|
assert(tc2:whnf(id_2(Type, id_2(Type, a))) == a)
|
||||||
local tc3 = type_checker(env, name_generator("foo"), {extra_opaque=name_set("id")})
|
local tc3 = type_checker(env, name_generator("foo"), {extra_opaque=name_set("id")})
|
||||||
|
print(tc3:whnf(id_2(Type, id_2(Type, a))))
|
||||||
assert(tc3:whnf(id_2(Type, id_2(Type, a))) == id_2(Type, id_2(Type, a)))
|
assert(tc3:whnf(id_2(Type, id_2(Type, a))) == id_2(Type, id_2(Type, a)))
|
||||||
print(id_2(Type, id_2(Type, a)))
|
print(id_2(Type, id_2(Type, a)))
|
||||||
|
|
Loading…
Add table
Reference in a new issue