Commit 055da6a8 by Ian Lance Taylor

compiler: discard carriage returns in raw string literals

Fixes golang/go#10407.

From-SVN: r222001
parent b025e292
......@@ -1440,7 +1440,10 @@ Lex::gather_raw_string()
bool issued_error;
this->lineoff_ = p - this->linebuf_;
p = this->advance_one_utf8_char(p, &c, &issued_error);
Lex::append_char(c, true, &value, loc);
// "Carriage return characters ('\r') inside raw string literals
// are discarded from the raw string value."
if (c != '\r')
Lex::append_char(c, true, &value, loc);
}
this->lineoff_ = p - this->linebuf_;
if (!this->require_line())
......
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