third trial: get the token i(vss) as a whole in the lexer,
this prevents the parser from generating the spurious vector vss. No need to do an extra translation i(vss) -> vss#branch.
This commit is contained in:
parent
7fcc65f22a
commit
a3917f49ec
|
|
@ -709,10 +709,8 @@ int PPlex(YYSTYPE *lvalp, struct PPltype *llocp, char **line)
|
||||||
*
|
*
|
||||||
* what is valid here ?
|
* what is valid here ?
|
||||||
* foo dc1.foo dc1.@m1[vth]
|
* foo dc1.foo dc1.@m1[vth]
|
||||||
* this too ?
|
|
||||||
* vthing#branch
|
* vthing#branch
|
||||||
* should we convert the pseudo identifier ?
|
* i(vthing)
|
||||||
* i(v5) --> v5#branch
|
|
||||||
*/
|
*/
|
||||||
for (; *sbuf && !strchr(specials, *sbuf); sbuf++)
|
for (; *sbuf && !strchr(specials, *sbuf); sbuf++)
|
||||||
if (*sbuf == '@') {
|
if (*sbuf == '@') {
|
||||||
|
|
@ -727,6 +725,14 @@ int PPlex(YYSTYPE *lvalp, struct PPltype *llocp, char **line)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
/* keep the identifier i(vss) as a single token, even as dc1.i(vss) */
|
||||||
|
else if (prefix("i(v", sbuf)) {
|
||||||
|
if (get_r_paren(&sbuf) == 1) {
|
||||||
|
fprintf(stderr, "Error: missing ')' in token\n %s\n", start);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
sbuf--;
|
||||||
|
}
|
||||||
|
|
||||||
lvalp->str = copy_substring(start, sbuf);
|
lvalp->str = copy_substring(start, sbuf);
|
||||||
lexer_return(TOK_STR, 0);
|
lexer_return(TOK_STR, 0);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue