further parse optimizations
This commit is contained in:
parent
5286d3d84c
commit
63965fc585
1 changed files with 17 additions and 13 deletions
30
tcc.c
30
tcc.c
|
@ -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':
|
||||||
if (return_linefeed) {
|
case '\f':
|
||||||
tok = TOK_LINEFEED;
|
case '\v':
|
||||||
return;
|
case '\r':
|
||||||
}
|
cinp();
|
||||||
|
goto redo_no_start;
|
||||||
|
|
||||||
|
case '\n':
|
||||||
|
if (return_linefeed) {
|
||||||
|
/* XXX: should eat token ? */
|
||||||
|
tok = TOK_LINEFEED;
|
||||||
|
} 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;
|
||||||
|
|
Loading…
Reference in a new issue