from parse_field_expression.
(parse_completion): Rename from in_parse_field.
* c-exp.y (lex_one_token): Update.
* completer.c (expression_completer): Update.
* go-exp.y (lex_one_token): Update.
* p-exp.y (yylex): Update.
* parse.c (parse_completion): Rename from in_parse_field.
(parse_exp_in_context): Update.
(parse_expression_for_completion): Rename from
parse_field_expression. Update.
+2012-12-07 Tom Tromey <tromey@redhat.com>
+
+ * expression.h (parse_expression_for_completion): Rename
+ from parse_field_expression.
+ (parse_completion): Rename from in_parse_field.
+ * c-exp.y (lex_one_token): Update.
+ * completer.c (expression_completer): Update.
+ * go-exp.y (lex_one_token): Update.
+ * p-exp.y (yylex): Update.
+ * parse.c (parse_completion): Rename from in_parse_field.
+ (parse_exp_in_context): Update.
+ (parse_expression_for_completion): Rename from
+ parse_field_expression. Update.
+
2012-12-07 Tom Tromey <tromey@redhat.com>
* typeprint.c (_initialize_typeprint): Set completer
lexptr += 2;
yylval.opcode = tokentab2[i].opcode;
- if (in_parse_field && tokentab2[i].token == ARROW)
+ if (parse_completion && tokentab2[i].token == ARROW)
last_was_structop = 1;
return tokentab2[i].token;
}
/* Might be a floating point number. */
if (lexptr[1] < '0' || lexptr[1] > '9')
{
- if (in_parse_field)
+ if (parse_completion)
last_was_structop = 1;
goto symbol; /* Nope, must be a symbol. */
}
if (*tokstart == '$')
return VARIABLE;
- if (in_parse_field && *lexptr == '\0')
+ if (parse_completion && *lexptr == '\0')
saw_name_at_eof = 1;
return NAME;
}
fieldname = NULL;
TRY_CATCH (except, RETURN_MASK_ERROR)
{
- type = parse_field_expression (text, &fieldname);
+ type = parse_expression_for_completion (text, &fieldname);
}
if (except.reason < 0)
return NULL;
extern struct expression *parse_expression (char *);
-extern struct type *parse_field_expression (char *, char **);
+extern struct type *parse_expression_for_completion (char *, char **);
extern struct expression *parse_exp_1 (char **, CORE_ADDR pc,
const struct block *, int);
/* For use by parsers; set if we want to parse an expression and
- attempt to complete a field name. */
-extern int in_parse_field;
+ attempt completion. */
+extern int parse_completion;
/* The innermost context required by the stack and register variables
we've encountered so far. To use this, set it to NULL, then call
/* Might be a floating point number. */
if (lexptr[1] < '0' || lexptr[1] > '9')
{
- if (in_parse_field)
+ if (parse_completion)
last_was_structop = 1;
goto symbol; /* Nope, must be a symbol. */
}
if (*tokstart == '$')
return DOLLAR_VARIABLE;
- if (in_parse_field && *lexptr == '\0')
+ if (parse_completion && *lexptr == '\0')
saw_name_at_eof = 1;
return NAME;
}
/* Might be a floating point number. */
if (lexptr[1] < '0' || lexptr[1] > '9')
{
- if (in_parse_field)
+ if (parse_completion)
last_was_structop = 1;
goto symbol; /* Nope, must be a symbol. */
}
if (search_field && current_type)
is_a_field = (lookup_struct_elt_type (current_type, tmp, 1) != NULL);
- if (is_a_field || in_parse_field)
+ if (is_a_field || parse_completion)
sym = NULL;
else
sym = lookup_symbol (tmp, expression_context_block,
}
if (search_field && current_type)
is_a_field = (lookup_struct_elt_type (current_type, tmp, 1) != NULL);
- if (is_a_field || in_parse_field)
+ if (is_a_field || parse_completion)
sym = NULL;
else
sym = lookup_symbol (tmp, expression_context_block,
}
if (search_field && current_type)
is_a_field = (lookup_struct_elt_type (current_type, tmp, 1) != NULL);
- if (is_a_field || in_parse_field)
+ if (is_a_field || parse_completion)
sym = NULL;
else
sym = lookup_symbol (tmp, expression_context_block,
int paren_depth;
int comma_terminates;
-/* True if parsing an expression to find a field reference. This is
- only used by completion. */
-int in_parse_field;
+/* True if parsing an expression to attempt completion. */
+int parse_completion;
/* The index of the last struct expression directly before a '.' or
'->'. This is set when parsing and is only used when completing a
}
if (except.reason < 0)
{
- if (! in_parse_field)
+ if (! parse_completion)
{
xfree (expout);
throw_exception (except);
*NAME must be freed by the caller. */
struct type *
-parse_field_expression (char *string, char **name)
+parse_expression_for_completion (char *string, char **name)
{
struct expression *exp = NULL;
struct value *val;
TRY_CATCH (except, RETURN_MASK_ERROR)
{
- in_parse_field = 1;
+ parse_completion = 1;
exp = parse_exp_in_context (&string, 0, 0, 0, 0, &subexp);
}
- in_parse_field = 0;
+ parse_completion = 0;
if (except.reason < 0 || ! exp)
return NULL;
if (expout_last_struct == -1)