va_list ap;
va_start(ap, fmt);
- con_vprintmsg(LVL_ERROR, lex->name, lex->sline, "parse error", fmt, ap);
+ if (lex)
+ con_vprintmsg(LVL_ERROR, lex->name, lex->sline, "parse error", fmt, ap);
+ else
+ con_vprintmsg(LVL_ERROR, "", 0, "parse error", fmt, ap);
va_end(ap);
}
if (lex->flags.preprocessing) {
haswhite = true;
+ /*
lex_tokench(lex, '/');
lex_tokench(lex, '/');
+ */
+ lex_tokench(lex, ' ');
+ lex_tokench(lex, ' ');
}
while (ch != EOF && ch != '\n') {
if (lex->flags.preprocessing)
- lex_tokench(lex, ch);
+ lex_tokench(lex, ' '); /* ch); */
ch = lex_getch(lex);
}
if (lex->flags.preprocessing) {
/* multiline comment */
if (lex->flags.preprocessing) {
haswhite = true;
+ /*
lex_tokench(lex, '/');
lex_tokench(lex, '*');
+ */
+ lex_tokench(lex, ' ');
+ lex_tokench(lex, ' ');
}
while (ch != EOF)
ch = lex_getch(lex);
if (ch == '/') {
if (lex->flags.preprocessing) {
+ /*
lex_tokench(lex, '*');
lex_tokench(lex, '/');
+ */
+ lex_tokench(lex, ' ');
+ lex_tokench(lex, ' ');
}
break;
}
}
if (lex->flags.preprocessing) {
- lex_tokench(lex, ch);
+ lex_tokench(lex, ' '); /* ch); */
}
}
ch = ' '; /* cause TRUE in the isspace check */
break;
}
/* we reached a linemerge */
+ lex_tokench(lex, '\n');
continue;
}
return (lex->tok.ttype = TOKEN_OPERATOR);
case ')':
case ';':
+ case ':':
case '{':
case '}':
case ']':