static int value_of(lua_State * L) { auto it = value_of(to_token_table(L, 1)); if (it) { push_boolean(L, it->is_command()); push_name(L, it->value()); push_integer(L, it->expr_precedence()); return 3; } else { push_nil(L); return 1; } }
static int is_fold_right(lua_State * L) { check_action(L, 1, { action_kind::Exprs }); return push_boolean(L, to_notation_action(L, 1).is_fold_right()); }
static int is_equal(lua_State * L) { return push_boolean(L, to_notation_action(L, 1).is_equal(to_notation_action(L, 2))); }
static int exception_pred(lua_State * L) { return push_boolean(L, is_exception(L, 1)); }
static int lua_rb_map_contains(lua_State * L) { return push_boolean(L, to_lua_rb_map(L, 1).contains(luaref(L, 2))); }
static int mpq_lt(lua_State * L) { return push_boolean(L, to_mpq<1>(L) < to_mpq<2>(L)); }
static int curr_is_numeral(lua_State * L) { return push_boolean(L, gparser.curr_is_numeral()); }
static int has_placeholder(lua_State * L) { if (is_expr(L, 1)) return push_boolean(L, has_placeholder(to_expr(L, 1))); else return push_boolean(L, has_placeholder(to_level(L, 1))); }
static int curr_is_token_or_id(lua_State * L) { return push_boolean(L, gparser.curr_is_token_or_id(to_name_ext(L, 1))); }
static int curr_is_identifier(lua_State * L) { return push_boolean(L, gparser.curr_is_identifier()); }
static int options_get_bool(lua_State * L) { int nargs = lua_gettop(L); bool defval = nargs < 3 ? false : lua_toboolean(L, 3); return push_boolean(L, to_options(L, 1).get_bool(to_name_ext(L, 2), defval)); }
static int options_empty(lua_State * L) { return push_boolean(L, to_options(L, 1).empty()); }
static int options_contains(lua_State * L) { return push_boolean(L, to_options(L, 1).contains(to_name_ext(L, 2))); }
static int use_lambda_abstraction(lua_State * L) { check_action(L, 1, { action_kind::ScopedExpr }); return push_boolean(L, to_notation_action(L, 1).use_lambda_abstraction()); }
static int curr_is_string(lua_State * L) { return push_boolean(L, gparser.curr_is_string()); }
static int is_nud(lua_State * L) { return push_boolean(L, to_parse_table(L, 1).is_nud()); }
static int curr_is_keyword(lua_State * L) { return push_boolean(L, gparser.curr_is_keyword()); }
void lutok::state::set_field(const std::string& name, const bool value, const int index){ push_literal(name); push_boolean(value); set_table(index); }
static int curr_is_command(lua_State * L) { return push_boolean(L, gparser.curr_is_command()); }
static int mpz_eq(lua_State * L) { return push_boolean(L, to_mpz<1>(L) == to_mpz<2>(L)); }
static int curr_is_quoted_symbol(lua_State * L) { return push_boolean(L, gparser.curr_is_quoted_symbol()); }
static int name_set_contains(lua_State * L) { return push_boolean(L, to_name_set(L, 1).contains(to_name_ext(L, 2))); }
static int is_choice(lua_State * L) { return push_boolean(L, is_choice(to_expr(L, 1))); }
static int lua_rb_map_empty(lua_State * L) { return push_boolean(L, to_lua_rb_map(L, 1).empty()); }
static int mpz_lt(lua_State * L) { return push_boolean(L, to_mpz_ext(L, 1) < to_mpz_ext(L, 2)); }