compiler: discard carriage returns in raw string literals
Fixes golang/go#10407. From-SVN: r222001
This commit is contained in:
parent
b025e2920e
commit
055da6a8df
|
@ -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())
|
||||
|
|
Loading…
Reference in New Issue