From 521506258fa5b6b57a50b0570d8208894ed19f79 Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Mon, 29 Mar 2010 11:00:43 -0400 Subject: Some raw string changes from N3077 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. From-SVN: r157797 --- libcpp/ChangeLog | 6 ++++++ libcpp/charset.c | 2 +- libcpp/lex.c | 10 +++++----- 3 files changed, 12 insertions(+), 6 deletions(-) (limited to 'libcpp') diff --git a/libcpp/ChangeLog b/libcpp/ChangeLog index eeab569..24030fb 100644 --- a/libcpp/ChangeLog +++ b/libcpp/ChangeLog @@ -1,3 +1,9 @@ +2010-03-29 Jason Merrill + + 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 * init.c (read_original_filename): Don't call read_original_directory diff --git a/libcpp/charset.c b/libcpp/charset.c index 837ccd7..282430f 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 ac28f92..74deab2 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] == '"') -- cgit v1.1