diff options
author | zack <zack@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-05-02 16:09:12 +0000 |
---|---|---|
committer | zack <zack@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-05-02 16:09:12 +0000 |
commit | d1678bc67c1a9a12253410e4f89a38f715f2a499 (patch) | |
tree | 90422d7ae261276adf06a32d02442c9b52f52170 /gcc/scan-decls.c | |
parent | 9805577e2777772efe3a3b2a9b163fedcd0127b9 (diff) | |
download | gcc-d1678bc67c1a9a12253410e4f89a38f715f2a499.tar.gz |
* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@33611 138bc75d-0d04-0410-961f-82ee72b054a4
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 8953da57859..e65d832fda0 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); |