diff options
author | neil <neil@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-11-08 23:08:07 +0000 |
---|---|---|
committer | neil <neil@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-11-08 23:08:07 +0000 |
commit | 230f09435a0964b0435bd27cb9824fdfdae21f64 (patch) | |
tree | 2829d58899280886dce9cbba61c7c88422fd36e6 /gcc/cppmacro.c | |
parent | 1aaa692a9b9dfd74aaae183447b5aaff0010bc61 (diff) | |
download | gcc-230f09435a0964b0435bd27cb9824fdfdae21f64.tar.gz |
Move directive handling into the lexer itself.
* cpplex.c (_cpp_lex_token): Handle directives directly.
In the case of a directive interrupting a function-like
macro invocation, use extra_char since read_ahead is
used to store the '#'. Return a CPP_EOF in this case.
* cppmacro.c (parse_arg): No need to handle CPP_DHASH any more.
(cpp_get_token): Don't handle directives here.
* cpplib.h: Remove CPP_DHASH token type.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@37329 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cppmacro.c')
-rw-r--r-- | gcc/cppmacro.c | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/gcc/cppmacro.c b/gcc/cppmacro.c index 24babafeefa..766a7197156 100644 --- a/gcc/cppmacro.c +++ b/gcc/cppmacro.c @@ -534,21 +534,6 @@ parse_arg (pfile, arg, var_args) break; else if (result == CPP_EOF) break; /* Error reported by caller. */ - else if (result == CPP_DHASH) - { - /* 6.10.3 paragraph 11: If there are sequences of - preprocessing tokens within the list of arguments that - would otherwise act as preprocessing directives, the - behavior is undefined. - - This implementation will report a hard error, terminate - the macro invocation, and proceed to process the - directive. */ - cpp_error (pfile, "directives may not be used inside a macro argument"); - _cpp_push_token (pfile, token, &pfile->lexer_pos); - result = CPP_EOF; - break; - } } /* Empty arguments become a single placemarker token. */ @@ -1019,16 +1004,6 @@ cpp_get_token (pfile, token) break; continue; } - else if (token->type == CPP_DHASH) - { - /* Handle directives. */ - if (_cpp_handle_directive (pfile, token->flags & PREV_WHITE)) - continue; - /* This is in fact an assembler #. */ - if (pfile->skipping) - continue; - token->type = CPP_HASH; - } /* 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) |