typedef struct {
lex_file *lex;
int token;
- bool newline;
unsigned int errors;
bool output_on;
break;
}
else {
- ftepp_error(ftepp, "unrecognized preprocessor directive: `%s`", ftepp_tokval(ftepp));
- return false;
+ if (ftepp->output_on) {
+ ftepp_error(ftepp, "unrecognized preprocessor directive: `%s`", ftepp_tokval(ftepp));
+ return false;
+ } else {
+ ftepp_next(ftepp);
+ break;
+ }
}
/* break; never reached */
default:
if (ftepp->token >= TOKEN_EOF)
break;
#if 0
- ftepp->newline = newline;
- newline = false;
-#else
- /* For the sake of FTE compatibility... FU, really */
- ftepp->newline = newline = true;
+ newline = true;
#endif
switch (ftepp->token) {
ftepp->token = TOKEN_ERROR;
break;
case '#':
- if (!ftepp->newline) {
+ if (!newline) {
ftepp_out(ftepp, ftepp_tokval(ftepp), false);
ftepp_next(ftepp);
break;
ftepp_out(ftepp, "\n", true);
ftepp_next(ftepp);
break;
+ case TOKEN_WHITE:
+ /* same as default but don't set newline=false */
+ ftepp_out(ftepp, ftepp_tokval(ftepp), false);
+ ftepp_next(ftepp);
+ break;
default:
+ newline = false;
ftepp_out(ftepp, ftepp_tokval(ftepp), false);
ftepp_next(ftepp);
break;
vec_push(ftepp->output_string, 0);
vec_shrinkby(ftepp->output_string, 1);
- newline = ftepp->token == TOKEN_EOF;
- return newline;
+ return (ftepp->token == TOKEN_EOF);
}
/* Like in parser.c - files keep the previous state so we have one global