Add support for negative constants in external initialisers.

This commit is contained in:
David Given 2016-12-31 19:43:03 +00:00
parent a01523a893
commit b1576e2c77

View file

@ -373,7 +373,15 @@ loop:
return subseq(c,PLUS,INCBEF);
case MINUS:
/* avoid peeking a name, which could overwrite
* an already set bsym. */
if (ctab[peekc = spnextchar()] == DIGIT) {
getnum();
cval = -cval;
return CON;
} else {
return subseq(c,MINUS,DECBEF);
}
case LESS:
if (subseq(c,0,1))