Commit 78af79ab by Richard Kenner

(skip_if_group): Check for traditional mode when skipping ahead to

next #, ignore unless at beginning of line.

From-SVN: r5257
parent 3c58aa35
/* C Compatible Compiler Preprocessor (CCCP) /* C Compatible Compiler Preprocessor (CCCP)
Copyright (C) 1986, 1987, 1989, 1992 Free Software Foundation, Inc. Copyright (C) 1986, 1987, 1989, 1992, 1993 Free Software Foundation, Inc.
Written by Paul Rubin, June 1986 Written by Paul Rubin, June 1986
Adapted to ANSI C, Richard Stallman, Jan 1987 Adapted to ANSI C, Richard Stallman, Jan 1987
...@@ -6429,22 +6429,24 @@ skip_if_group (ip, any) ...@@ -6429,22 +6429,24 @@ skip_if_group (ip, any)
and backslash-newlines, and see if we reach this #. and backslash-newlines, and see if we reach this #.
If not, this # is not special. */ If not, this # is not special. */
bp = beg_of_line; bp = beg_of_line;
while (1) { /* If -traditional, require # to be at beginning of line. */
if (is_hor_space[*bp]) if (!traditional)
bp++; while (1) {
else if (*bp == '\\' && bp[1] == '\n') if (is_hor_space[*bp])
bp += 2;
else if (*bp == '/' && bp[1] == '*') {
bp += 2;
while (!(*bp == '*' && bp[1] == '/'))
bp++; bp++;
bp += 2; else if (*bp == '\\' && bp[1] == '\n')
} else if (cplusplus_comments && *bp == '/' && bp[1] == '/') { bp += 2;
bp += 2; else if (*bp == '/' && bp[1] == '*') {
while (*bp++ != '\n') ; bp += 2;
} while (!(*bp == '*' && bp[1] == '/'))
else break; bp++;
} bp += 2;
} else if (cplusplus_comments && *bp == '/' && bp[1] == '/') {
bp += 2;
while (*bp++ != '\n') ;
}
else break;
}
if (bp != ip->bufp) { if (bp != ip->bufp) {
bp = ip->bufp + 1; /* Reset bp to after the #. */ bp = ip->bufp + 1; /* Reset bp to after the #. */
break; break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment