diff options
author | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-03-29 15:00:43 +0000 |
---|---|---|
committer | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-03-29 15:00:43 +0000 |
commit | 7fe0ef3add4739e6e03d6a75cafd25a09198c5a4 (patch) | |
tree | 876f46ded2898ed88f7228731ce8d1688068e6d7 /libcpp | |
parent | 1da234593cd89d22d1661961d223518d07b73012 (diff) | |
download | gcc-7fe0ef3add4739e6e03d6a75cafd25a09198c5a4.tar.gz |
Some raw string changes from N3077
* charset.c (cpp_interpret_string): Change inner delimiters to ().
* lex.c (lex_raw_string): Likewise. Also disallow '\' in delimiter.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@157797 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libcpp')
-rw-r--r-- | libcpp/ChangeLog | 6 | ||||
-rw-r--r-- | libcpp/charset.c | 2 | ||||
-rw-r--r-- | libcpp/lex.c | 10 |
3 files changed, 12 insertions, 6 deletions
diff --git a/libcpp/ChangeLog b/libcpp/ChangeLog index eeab5699bca..24030fb4c8a 100644 --- a/libcpp/ChangeLog +++ b/libcpp/ChangeLog @@ -1,3 +1,9 @@ +2010-03-29 Jason Merrill <jason@redhat.com> + + Some raw string changes from N3077 + * charset.c (cpp_interpret_string): Change inner delimiters to (). + * lex.c (lex_raw_string): Likewise. Also disallow '\' in delimiter. + 2010-02-11 Jakub Jelinek <jakub@redhat.com> * init.c (read_original_filename): Don't call read_original_directory diff --git a/libcpp/charset.c b/libcpp/charset.c index 837ccd77aab..282430fe9ed 100644 --- a/libcpp/charset.c +++ b/libcpp/charset.c @@ -1396,7 +1396,7 @@ cpp_interpret_string (cpp_reader *pfile, const cpp_string *from, size_t count, /* Skip over 'R"'. */ p += 2; prefix = p; - while (*p != '[') + while (*p != '(') p++; p++; limit = from[i].text + from[i].len; diff --git a/libcpp/lex.c b/libcpp/lex.c index ac28f92e640..74deab20608 100644 --- a/libcpp/lex.c +++ b/libcpp/lex.c @@ -703,7 +703,7 @@ lex_raw_string (cpp_reader *pfile, cpp_token *token, const uchar *base, { switch (raw_prefix[raw_prefix_len]) { - case ' ': case '[': case ']': case '\t': + case ' ': case '(': case ')': case '\\': case '\t': case '\v': case '\f': case '\n': default: break; /* Basic source charset except the above chars. */ @@ -719,18 +719,18 @@ lex_raw_string (cpp_reader *pfile, cpp_token *token, const uchar *base, case 'Y': case 'Z': case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': - case '_': case '{': case '}': case '#': case '(': case ')': + case '_': case '{': case '}': case '#': case '[': case ']': case '<': case '>': case '%': case ':': case ';': case '.': case '?': case '*': case '+': case '-': case '/': case '^': case '&': case '|': case '~': case '!': case '=': case ',': - case '\\': case '"': case '\'': + case '"': case '\'': raw_prefix_len++; continue; } break; } - if (raw_prefix[raw_prefix_len] != '[') + if (raw_prefix[raw_prefix_len] != '(') { int col = CPP_BUF_COLUMN (pfile->buffer, raw_prefix + raw_prefix_len) + 1; @@ -751,7 +751,7 @@ lex_raw_string (cpp_reader *pfile, cpp_token *token, const uchar *base, { cppchar_t c = *cur++; - if (c == ']' + if (c == ')' && strncmp ((const char *) cur, (const char *) raw_prefix, raw_prefix_len) == 0 && cur[raw_prefix_len] == '"') |