further parse optimizations

This commit is contained in:
bellard 2002-11-22 13:37:52 +00:00
parent 5286d3d84c
commit 63965fc585

24
tcc.c
View file

@ -2675,14 +2675,21 @@ static inline void next_nomacro1(void)
char *q; char *q;
TokenSym *ts; TokenSym *ts;
/* skip spaces */ redo_no_start:
while(1) { switch(ch) {
while (ch == '\n') { case ' ':
/* during preprocessor parsing, '\n' is a token */ case '\t':
case '\f':
case '\v':
case '\r':
cinp();
goto redo_no_start;
case '\n':
if (return_linefeed) { if (return_linefeed) {
/* XXX: should eat token ? */
tok = TOK_LINEFEED; tok = TOK_LINEFEED;
return; } else {
}
cinp(); cinp();
skip_spaces(); skip_spaces();
if (ch == '#') { if (ch == '#') {
@ -2690,12 +2697,9 @@ static inline void next_nomacro1(void)
spaces */ spaces */
preprocess(); preprocess();
} }
goto redo_no_start;
} }
if (!is_space(ch))
break; break;
cinp();
}
switch(ch) {
case '#': case '#':
tok = ch; tok = ch;