diff options
author | Richard Kenner <kenner@gcc.gnu.org> | 1993-09-03 18:03:32 -0400 |
---|---|---|
committer | Richard Kenner <kenner@gcc.gnu.org> | 1993-09-03 18:03:32 -0400 |
commit | 78af79ab5abdbfc756d51c01cea43bb9366496d7 (patch) | |
tree | 39450a24efc13872cf32527a9310cb03a376d57a | |
parent | 3c58aa350db775eb62cbbdcc12d92889bb51b5bf (diff) | |
download | gcc-78af79ab5abdbfc756d51c01cea43bb9366496d7.zip gcc-78af79ab5abdbfc756d51c01cea43bb9366496d7.tar.gz gcc-78af79ab5abdbfc756d51c01cea43bb9366496d7.tar.bz2 |
(skip_if_group): Check for traditional mode when skipping ahead to
next #, ignore unless at beginning of line.
From-SVN: r5257
-rw-r--r-- | gcc/cccp.c | 34 |
1 files changed, 18 insertions, 16 deletions
@@ -1,5 +1,5 @@ /* 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 Adapted to ANSI C, Richard Stallman, Jan 1987 @@ -6429,22 +6429,24 @@ skip_if_group (ip, any) and backslash-newlines, and see if we reach this #. If not, this # is not special. */ bp = beg_of_line; - while (1) { - if (is_hor_space[*bp]) - bp++; - else if (*bp == '\\' && bp[1] == '\n') - bp += 2; - else if (*bp == '/' && bp[1] == '*') { - bp += 2; - while (!(*bp == '*' && bp[1] == '/')) + /* If -traditional, require # to be at beginning of line. */ + if (!traditional) + while (1) { + if (is_hor_space[*bp]) bp++; - bp += 2; - } else if (cplusplus_comments && *bp == '/' && bp[1] == '/') { - bp += 2; - while (*bp++ != '\n') ; - } - else break; - } + else if (*bp == '\\' && bp[1] == '\n') + bp += 2; + else if (*bp == '/' && bp[1] == '*') { + bp += 2; + while (!(*bp == '*' && bp[1] == '/')) + bp++; + bp += 2; + } else if (cplusplus_comments && *bp == '/' && bp[1] == '/') { + bp += 2; + while (*bp++ != '\n') ; + } + else break; + } if (bp != ip->bufp) { bp = ip->bufp + 1; /* Reset bp to after the #. */ break; |