diff options
author | Neil Booth <neilb@earthling.net> | 2000-11-09 21:18:15 +0000 |
---|---|---|
committer | Neil Booth <neil@gcc.gnu.org> | 2000-11-09 21:18:15 +0000 |
commit | a949941cf79dc2bee4e741ce3928e11c4053f257 (patch) | |
tree | faf4076c83d65bd44e0d82d85813fd94e77029cf /gcc/cppmacro.c | |
parent | 9a0662b4d5ca89808c149d69d271068ae0e54560 (diff) | |
download | gcc-a949941cf79dc2bee4e741ce3928e11c4053f257.tar.gz |
cpphash.c: Move cpp_defined here from cpplib.c.
* cpphash.c: Move cpp_defined here from cpplib.c.
* cpplib.c: Update comments, move cpp_defined to cpphash.c.
* cpplex.c (_cpp_lex_token): Don't leave the lexer at EOL.
* cppmacro.c (cpp_get_token): Update comments, no need now
to catch the CPP_EOF meaning EOL case.
From-SVN: r37345
Diffstat (limited to 'gcc/cppmacro.c')
-rw-r--r-- | gcc/cppmacro.c | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/gcc/cppmacro.c b/gcc/cppmacro.c index 766a7197156..ec3590ea7e6 100644 --- a/gcc/cppmacro.c +++ b/gcc/cppmacro.c @@ -902,9 +902,10 @@ _cpp_pop_context (pfile) } /* Internal routine to return a token, either from an in-progress - macro expansion, or from the source file as appropriate. Handles - macros, so tokens returned are post-expansion. Does not filter - CPP_PLACEMARKER tokens. Returns CPP_EOF at EOL and EOF. */ + macro expansion, or from the source file as appropriate. + Transparently enters included files. Handles macros, so tokens + returned are post-expansion. Does not filter CPP_PLACEMARKER + tokens. Returns CPP_EOF at EOL and EOF. */ void _cpp_get_token (pfile, token) cpp_reader *pfile; @@ -929,6 +930,7 @@ _cpp_get_token (pfile, token) _cpp_pop_context (pfile); continue; } + /* End of argument pre-expansion. */ token->type = CPP_EOF; token->flags = 0; } @@ -981,12 +983,13 @@ _cpp_get_token (pfile, token) /* External interface to get a token. Tokens are returned after macro expansion and directives have been handled, as a continuous stream. - Transparently enters included files. CPP_EOF indicates end of - original source file. Filters out CPP_PLACEMARKER tokens. + Compared to the function above, CPP_EOF means EOF, and placemarker + tokens are filtered out. Also, it skips tokens if we're skipping, + and saves tokens to lookahead. - For the benefit of #pragma callbacks which may want to get the - pragma's tokens, returns CPP_EOF to indicate end-of-directive in - this case. */ + CPP_EOF indicates end of original source file. For the benefit of + #pragma callbacks which may want to get the pragma's tokens, + returns CPP_EOF to indicate end-of-directive in this case. */ void cpp_get_token (pfile, token) cpp_reader *pfile; @@ -997,13 +1000,7 @@ cpp_get_token (pfile, token) _cpp_get_token (pfile, token); if (token->type == CPP_EOF) - { - /* In directives we should pass through EOLs for the callbacks. */ - if (pfile->buffer->cur == pfile->buffer->rlimit - || pfile->state.in_directive || pfile->state.parsing_args) - break; - continue; - } + break; /* We are not merging the PREV_WHITE of CPP_PLACEMARKERS. I don't think it really matters. */ else if (pfile->skipping || token->type == CPP_PLACEMARKER) |