static void rustyyerror (rust_parser *parser, const char *msg);
static struct stoken make_stoken (const char *);
static void rustyyerror (rust_parser *parser, const char *msg);
static struct stoken make_stoken (const char *);
/* A regular expression for matching Rust numbers. This is split up
since it is very long and this gives us a way to comment the
/* A regular expression for matching Rust numbers. This is split up
since it is very long and this gives us a way to comment the
+ void update_innermost_block (struct block_symbol sym);
+ struct block_symbol lookup_symbol (const char *name,
+ const struct block *block,
+ const domain_enum domain);
struct type *rust_lookup_type (const char *name, const struct block *block);
std::vector<struct type *> convert_params_to_types (rust_op_vector *params);
struct type *convert_ast_to_type (const struct rust_op *operation);
struct type *rust_lookup_type (const char *name, const struct block *block);
std::vector<struct type *> convert_params_to_types (rust_op_vector *params);
struct type *convert_ast_to_type (const struct rust_op *operation);
/* Like lookup_symbol, but handles Rust namespace conventions, and
doesn't require field_of_this_result. */
/* Like lookup_symbol, but handles Rust namespace conventions, and
doesn't require field_of_this_result. */
-static struct block_symbol
-rust_lookup_symbol (const char *name, const struct block *block,
- const domain_enum domain)
+struct block_symbol
+rust_parser::lookup_symbol (const char *name, const struct block *block,
+ const domain_enum domain)
{
struct block_symbol result;
munge_name_and_block (&name, &block);
{
struct block_symbol result;
munge_name_and_block (&name, &block);
- result = lookup_symbol (name, block, domain, NULL);
+ result = ::lookup_symbol (name, block, domain, NULL);
- result = lookup_symbol (name, block, STRUCT_DOMAIN, NULL);
+ result = ::lookup_symbol (name, block, STRUCT_DOMAIN, NULL);
if (result.symbol != NULL)
{
update_innermost_block (result);
return SYMBOL_TYPE (result.symbol);
}
if (result.symbol != NULL)
{
update_innermost_block (result);
return SYMBOL_TYPE (result.symbol);
}
- type = lookup_typename (language (), arch (), name, NULL, 1);
+ type = lookup_typename (language (), name, NULL, 1);
if (sym.symbol != NULL && SYMBOL_CLASS (sym.symbol) != LOC_TYPEDEF)
{
write_exp_elt_opcode (pstate, OP_VAR_VALUE);
if (sym.symbol != NULL && SYMBOL_CLASS (sym.symbol) != LOC_TYPEDEF)
{
write_exp_elt_opcode (pstate, OP_VAR_VALUE);
-rust_lex_int_test (rust_parser *parser, const char *input, int value, int kind)
+rust_lex_int_test (rust_parser *parser, const char *input,
+ LONGEST value, int kind)
{
RUSTSTYPE result = rust_lex_test_one (parser, input, kind);
SELF_CHECK (result.typed_val_int.val == value);
{
RUSTSTYPE result = rust_lex_test_one (parser, input, kind);
SELF_CHECK (result.typed_val_int.val == value);
{
/* The "kind" doesn't matter. */
rust_lex_test_one (parser, input, DECIMAL_INTEGER);
SELF_CHECK (0);
}
{
/* The "kind" doesn't matter. */
rust_lex_test_one (parser, input, DECIMAL_INTEGER);
SELF_CHECK (0);
}
// Set up dummy "parser", so that rust_type works.
struct parser_state ps (&rust_language_defn, target_gdbarch (),
// Set up dummy "parser", so that rust_type works.
struct parser_state ps (&rust_language_defn, target_gdbarch (),
- nullptr, 0, 0, nullptr, 0);
+ nullptr, 0, 0, nullptr, 0, nullptr);
rust_parser parser (&ps);
rust_lex_test_one (&parser, "", 0);
rust_parser parser (&ps);
rust_lex_test_one (&parser, "", 0);
rust_lex_int_test (&parser, "0x1_f", 0x1f, INTEGER);
rust_lex_int_test (&parser, "0b1_101011__", 0x6b, INTEGER);
rust_lex_int_test (&parser, "0o001177i64", 639, INTEGER);
rust_lex_int_test (&parser, "0x1_f", 0x1f, INTEGER);
rust_lex_int_test (&parser, "0b1_101011__", 0x6b, INTEGER);
rust_lex_int_test (&parser, "0o001177i64", 639, INTEGER);