aboutsummaryrefslogtreecommitdiff
path: root/gcc/cpphash.c
diff options
context:
space:
mode:
authorZack Weinberg <zack@wolery.cumb.org>2000-07-15 19:29:14 +0000
committerZack Weinberg <zack@gcc.gnu.org>2000-07-15 19:29:14 +0000
commit2c0accc920f19896d91fc0afb8cb8825a5147dbe (patch)
tree13e7a6035db05f91cea3851df746122575c0e6a7 /gcc/cpphash.c
parenta8c12308a05ef399cf985d3c9382207a801c310c (diff)
downloadgcc-2c0accc920f19896d91fc0afb8cb8825a5147dbe.zip
gcc-2c0accc920f19896d91fc0afb8cb8825a5147dbe.tar.gz
gcc-2c0accc920f19896d91fc0afb8cb8825a5147dbe.tar.bz2
cpphash.c (save_expansion): Clear PREV_WHITE on tokens immediately following a paste operator.
* cpphash.c (save_expansion): Clear PREV_WHITE on tokens immediately following a paste operator. * cppinit.c (sort_options): New function (only for HOST_EBCDIC). (cpp_reader_init): Call it, if HOST_EBCDIC. (cpp_handle_options): Do not sort option list here. (handle_option): Rename to cpp_handle_option and export. * cpplex.c (cpp_scan_buffer_nooutput, cpp_scan_buffer): Use _cpp_get_token directly. (cpp_scan_line): Return 0 at EOF, 1 otherwise. * cpplib.c (cpp_push_buffer): Don't set new->lineno to 1. * cpplib.h: Prototype cpp_handle_option. Update prototype of cpp_scan_line. From-SVN: r35052
Diffstat (limited to 'gcc/cpphash.c')
-rw-r--r--gcc/cpphash.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/cpphash.c b/gcc/cpphash.c
index 8c4be52..b7f3944 100644
--- a/gcc/cpphash.c
+++ b/gcc/cpphash.c
@@ -576,6 +576,11 @@ save_expansion (pfile, info)
dest->flags = token[-1].flags | STRINGIFY_ARG;
else
dest->flags = token->flags; /* Particularly PREV_WHITE. */
+ /* Turn off PREV_WHITE if we immediately follow a paste.
+ That way, even if the paste turns out to be illegal, there
+ will be no space between the two tokens in the output. */
+ if (token[-1].type == CPP_PASTE)
+ dest->flags &= ~PREV_WHITE;
dest++;
continue;
@@ -602,6 +607,8 @@ save_expansion (pfile, info)
dest->val.str.text = buf;
buf += dest->val.str.len;
}
+ if (token[-1].type == CPP_PASTE)
+ dest->flags &= ~PREV_WHITE;
dest++;
}