aboutsummaryrefslogtreecommitdiff
path: root/gcc/cpphash.c
diff options
context:
space:
mode:
authorZack Weinberg <zack@bitmover.com>1999-08-04 20:39:33 +0000
committerZack Weinberg <zack@gcc.gnu.org>1999-08-04 20:39:33 +0000
commit5d83f44baa49fbeadb9b5c35cb15e3f8a860802f (patch)
tree7dea07caa27d775c7af2d93e14dea09352a6d2e9 /gcc/cpphash.c
parent2a94e396c65da274a48a7d572d3e229dace92308 (diff)
downloadgcc-5d83f44baa49fbeadb9b5c35cb15e3f8a860802f.zip
gcc-5d83f44baa49fbeadb9b5c35cb15e3f8a860802f.tar.gz
gcc-5d83f44baa49fbeadb9b5c35cb15e3f8a860802f.tar.bz2
cpphash.c (macroexpand): Delete leading whitespace when arg is concatenated before.
Wed Aug 4 13:29:23 1999 Zack Weinberg <zack@bitmover.com> * cpphash.c (macroexpand): Delete leading whitespace when arg is concatenated before. (unsafe_chars): Correct test for whether + and - can extend a token. * cppinit.c (cpp_start_read): Do dependencies for -include/-imacros files also. * cpplib.c (cpp_scan_buffer): In no-output mode, don't bother tokenizing non-directive lines. (cpp_expand_to_buffer): Temporarily disable no-output mode. * cppmain.c: In no-output mode, just call cpp_scan_buffer for the input file. From-SVN: r28512
Diffstat (limited to 'gcc/cpphash.c')
-rw-r--r--gcc/cpphash.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/gcc/cpphash.c b/gcc/cpphash.c
index 552cf2e..2b5291b 100644
--- a/gcc/cpphash.c
+++ b/gcc/cpphash.c
@@ -1337,10 +1337,17 @@ macroexpand (pfile, hp)
U_CHAR *l1 = p1 + arg->raw_length;
if (ap->raw_before)
{
- while (p1 != l1 && is_space[*p1])
- p1++;
- while (p1 != l1 && is_idchar[*p1])
- xbuf[totlen++] = *p1++;
+ /* Arg is concatenated before: delete leading whitespace,
+ whitespace markers, and no-reexpansion markers. */
+ while (p1 != l1)
+ {
+ if (is_space[p1[0]])
+ p1++;
+ else if (p1[0] == '\r')
+ p1 += 2;
+ else
+ break;
+ }
}
if (ap->raw_after)
{
@@ -1460,15 +1467,12 @@ unsafe_chars (c1, c2)
{
switch (c1)
{
- case '+':
- case '-':
+ case '+': case '-':
if (c2 == c1 || c2 == '=')
return 1;
goto letter;
- case '.': case '0': case '1': case '2': case '3':
- case '4': case '5': case '6': case '7': case '8':
- case '9': case 'e': case 'E': case 'p': case 'P':
+ case 'e': case 'E': case 'p': case 'P':
if (c2 == '-' || c2 == '+')
return 1; /* could extend a pre-processing number */
goto letter;
@@ -1478,6 +1482,8 @@ unsafe_chars (c1, c2)
return 1; /* Could turn into L"xxx" or L'xxx'. */
goto letter;
+ case '.': case '0': case '1': case '2': case '3':
+ case '4': case '5': case '6': case '7': case '8': case '9':
case '_': case 'a': case 'b': case 'c': case 'd': case 'f':
case 'g': case 'h': case 'i': case 'j': case 'k': case 'l':
case 'm': case 'n': case 'o': case 'q': case 'r': case 's':