diff options
author | Zack Weinberg <zack@wolery.cumb.org> | 2000-05-02 16:09:12 +0000 |
---|---|---|
committer | Zack Weinberg <zack@gcc.gnu.org> | 2000-05-02 16:09:12 +0000 |
commit | c56c2073a6268960931acd0b852b6186d4bde179 (patch) | |
tree | 90422d7ae261276adf06a32d02442c9b52f52170 /gcc/scan-decls.c | |
parent | 753e6cf1b64ccc2e8f7946d4a7a010f82ff99c31 (diff) | |
download | gcc-c56c2073a6268960931acd0b852b6186d4bde179.zip gcc-c56c2073a6268960931acd0b852b6186d4bde179.tar.gz gcc-c56c2073a6268960931acd0b852b6186d4bde179.tar.bz2 |
cpplib.h (CPP_POP, [...]): Delete.
* cpplib.h (CPP_POP, parse_cleanup_t): Delete.
(cpp_buffer): Remove cleanup, seen_eof, manual_pop members.
* cppfiles.c (file_cleanup): Delete.
* cpphash.c (macro_cleanup): Delete.
(collect_objlike_expansion, collect_funlike_expansion,
macarg, scan_arguments): Remove CPP_POP case.
* cpplex.c (null_cleanup): Delete.
(cpp_pop_buffer): Do the work that was done in the cleanups
here. Call _cpp_unwind_if_stack from here.
(_cpp_expand_to_buffer, cpp_scan_buffer_nooutput,
cpp_scan_buffer): Run until we see CPP_EOF and the top of
stack is the buffer _below_ the one we stacked.
(cpp_get_token): Always pop an exhausted buffer. Return
CPP_EOF unless it's a macro buffer. Don't call _cpp_handle_eof.
* cpplib.c (skip_if_group): Don't call cpp_get_token to
increment the line number.
(_cpp_handle_eof): Rename to _cpp_unwind_if_stack.
* fix-header.c (read_scan_file) [parsing getchar()]: Run until
we see CPP_EOF and the top of stack is the buffer _below_ the
one we stacked.
* scan-decls.c: Likewise.
From-SVN: r33611
Diffstat (limited to 'gcc/scan-decls.c')
-rw-r--r-- | gcc/scan-decls.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/gcc/scan-decls.c b/gcc/scan-decls.c index 8953da5..e65d832 100644 --- a/gcc/scan-decls.c +++ b/gcc/scan-decls.c @@ -116,7 +116,12 @@ scan_decls (pfile, argc, argv) goto new_statement; } if (token == CPP_EOF) - return 0; + { + if (CPP_BUFFER (pfile) == NULL) + return 0; + else + goto new_statement; + } if (token == CPP_SEMICOLON) goto new_statement; if (token != CPP_NAME) @@ -235,13 +240,15 @@ scan_decls (pfile, argc, argv) prev_id_end = CPP_WRITTEN (pfile); break; - case CPP_EOF: - return 0; - case CPP_OPEN_BRACE: case CPP_CLOSE_BRACE: case CPP_DIRECTIVE: goto new_statement; /* handle_statement? */ - case CPP_HSPACE: case CPP_VSPACE: case CPP_COMMENT: case CPP_POP: + case CPP_EOF: + if (CPP_BUFFER (pfile) == NULL) + return 0; + /* else fall through */ + + case CPP_HSPACE: case CPP_VSPACE: case CPP_COMMENT: /* Skip initial white space. */ if (start_written == 0) CPP_SET_WRITTEN (pfile, 0); |