/* Bison Action Scanner -*- C -*-
- Copyright (C) 2006-2013 Free Software Foundation, Inc.
+ Copyright (C) 2006-2014 Free Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler.
/* POSIX says that a tag must be both an id and a C union member, but
historically almost any character is allowed in a tag. We disallow
- NUL and newline, as this simplifies our implementation. */
-tag [^\0\n>]+
+ NUL and newline, as this simplifies our implementation. We allow
+ "->" as a means to dereference a pointer. */
+tag ([^\0\n>]|->)+
/* Zero or more instances of backslash-newline. Following GCC, allow
white space between the backslash and the newline. */
{
static struct obstack msg_buf;
const char *tail = explicit_bracketing ? "" : cp + strlen (var->id);
- const char *id = var->hidden_by ? var->hidden_by->id : var->id;
- location id_loc = var->hidden_by ? var->hidden_by->loc : var->loc;
+ const char *id;
+ location id_loc;
+
+ if (var->hidden_by)
+ {
+ id = var->hidden_by->id;
+ id_loc = var->hidden_by->loc;
+ }
+ else
+ {
+ id = var->id;
+ id_loc = var->loc;
+ }
/* Create the explanation message. */
obstack_init (&msg_buf);
return INVALID_REF;
}
}
-
- /* Not reachable. */
- return INVALID_REF;
}
/* Keeps track of the maximum number of semantic values to the left of
if (*cp == '<')
{
*type_name = ++cp;
- while (*cp != '>')
+ /* Series of non-'>' or "->". */
+ while (*cp != '>' || cp[-1] == '-')
++cp;
/* The '>' symbol will be later replaced by '\0'. Original