diff options
| author | bellard <bellard> | 2002-11-22 13:37:52 +0000 |
|---|---|---|
| committer | bellard <bellard> | 2002-11-22 13:37:52 +0000 |
| commit | 63965fc585a3149c0488a13ecfcc0d1aa9317bb7 (patch) | |
| tree | d40c6a478bc8a5c5a2256bb31b05ea93e7561561 | |
| parent | 5286d3d84c83e966e0e0c6e059c0533fc8c76b44 (diff) | |
| download | tinycc-63965fc585a3149c0488a13ecfcc0d1aa9317bb7.tar.gz tinycc-63965fc585a3149c0488a13ecfcc0d1aa9317bb7.tar.bz2 | |
further parse optimizations
| -rw-r--r-- | tcc.c | 30 |
1 files changed, 17 insertions, 13 deletions
@@ -2675,14 +2675,21 @@ static inline void next_nomacro1(void) char *q; TokenSym *ts; - /* skip spaces */ - while(1) { - while (ch == '\n') { - /* during preprocessor parsing, '\n' is a token */ - if (return_linefeed) { - tok = TOK_LINEFEED; - return; - } + redo_no_start: + switch(ch) { + case ' ': + case '\t': + case '\f': + case '\v': + case '\r': + cinp(); + goto redo_no_start; + + case '\n': + if (return_linefeed) { + /* XXX: should eat token ? */ + tok = TOK_LINEFEED; + } else { cinp(); skip_spaces(); if (ch == '#') { @@ -2690,12 +2697,9 @@ static inline void next_nomacro1(void) spaces */ preprocess(); } + goto redo_no_start; } - if (!is_space(ch)) - break; - cinp(); - } - switch(ch) { + break; case '#': tok = ch; |
