mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 20:33:03 +00:00
* src/lex.c (read_typename): New function.
(lex): Use it. * src/reader.c (copy_dollar): Likewise.
This commit is contained in:
23
src/reader.c
23
src/reader.c
@@ -344,22 +344,12 @@ copy_dollar (FILE *fin, FILE *fout,
|
||||
int c = getc (fin);
|
||||
char *type_name = NULL;
|
||||
|
||||
/* Get the typename if explicit. */
|
||||
/* Get the type name if explicit. */
|
||||
if (c == '<')
|
||||
{
|
||||
char *cp = token_buffer;
|
||||
|
||||
while ((c = getc (fin)) != '>' && c > 0)
|
||||
{
|
||||
if (cp == token_buffer + maxtoken)
|
||||
cp = grow_token_buffer (cp);
|
||||
|
||||
*cp++ = c;
|
||||
}
|
||||
*cp = 0;
|
||||
read_type_name (fin);
|
||||
type_name = token_buffer;
|
||||
value_components_used = 1;
|
||||
|
||||
c = getc (fin);
|
||||
}
|
||||
|
||||
@@ -1372,9 +1362,9 @@ readgram (void)
|
||||
{
|
||||
bucket *sdummy;
|
||||
|
||||
/* Since the action was written out with this rule's */
|
||||
/* number, we must give the new rule this number */
|
||||
/* by inserting the new rule before it. */
|
||||
/* Since the action was written out with this rule's
|
||||
number, we must give the new rule this number by
|
||||
inserting the new rule before it. */
|
||||
|
||||
/* Make a dummy nonterminal, a gensym. */
|
||||
sdummy = gensym ();
|
||||
@@ -1395,7 +1385,8 @@ readgram (void)
|
||||
p->next = crule1;
|
||||
crule1->next = crule;
|
||||
|
||||
/* insert the dummy generated by that rule into this rule. */
|
||||
/* Insert the dummy generated by that rule into this
|
||||
rule. */
|
||||
nitems++;
|
||||
p = XCALLOC (symbol_list, 1);
|
||||
p->sym = sdummy;
|
||||
|
||||
Reference in New Issue
Block a user