bool newline = true;
ftepp->lex->flags.preprocessing = true;
- ftepp->lex->flags.noops = true;
+ ftepp->lex->flags.mergelines = true;
+ ftepp->lex->flags.noops = true;
ftepp_next(ftepp);
do
return TOKEN_FATAL;
#endif
- ch = lex_skipwhite(lex);
+ while (true) {
+ ch = lex_skipwhite(lex);
+ if (!lex->flags.mergelines || ch != '\\')
+ break;
+ ch = lex_getch(lex);
+ if (ch != '\n') {
+ lex_ungetch(lex, ch);
+ ch = '\\';
+ break;
+ }
+ /* we reached a linemerge */
+ continue;
+ }
+
lex->sline = lex->line;
lex->tok.ctx.line = lex->sline;
lex->tok.ctx.file = lex->name;
bool noops;
bool nodigraphs; /* used when lexing string constants */
bool preprocessing; /* whitespace and EOLs become actual tokens */
+ bool mergelines; /* backslash at the end of a line escapes the newline */
} flags;
int framevalue;