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; } }
// Parses an expression, returning the final result. Operand expr(Parser *parser) { return expr_precedence(parser, PREC_NONE); }
optional<unsigned> get_expr_precedence(token_table const & s, char const * token) { auto it = find(s, token); return it ? optional<unsigned>(it->expr_precedence()) : optional<unsigned>(); }