Commit df15e82d authored by tfarina@chromium.org's avatar tfarina@chromium.org

gn: Call GetCurrentLocation() in the STRING case as well.

I don't see any reason for not calling it there as we already do this in
the other cases.

BUG=None
TEST=None
R=brettw@chromium.org

Review URL: https://codereview.chromium.org/282163002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@270783 0039d316-1c4b-4281-b951-d872f2087c98
parent f1100b95
......@@ -231,8 +231,8 @@ void Tokenizer::AdvanceToEndOfToken(const Location& location,
if (!IsCurrentWhitespace() && !CouldBeOperator(c) &&
!IsScoperChar(c) && c != ',') {
*err_ = Err(GetCurrentLocation(),
"This is not a valid number.",
"Learn to count.");
"This is not a valid number.",
"Learn to count.");
// Highlight the number.
err_->AppendRange(LocationRange(location, GetCurrentLocation()));
}
......@@ -244,19 +244,17 @@ void Tokenizer::AdvanceToEndOfToken(const Location& location,
Advance(); // Advance past initial "
for (;;) {
if (at_end()) {
*err_ = Err(LocationRange(location,
Location(input_file_, line_number_, char_in_line_)),
"Unterminated string literal.",
"Don't leave me hanging like this!");
*err_ = Err(LocationRange(location, GetCurrentLocation()),
"Unterminated string literal.",
"Don't leave me hanging like this!");
break;
}
if (IsCurrentStringTerminator(initial)) {
Advance(); // Skip past last "
break;
} else if (cur_char() == '\n') {
*err_ = Err(LocationRange(location,
GetCurrentLocation()),
"Newline in string constant.");
*err_ = Err(LocationRange(location, GetCurrentLocation()),
"Newline in string constant.");
}
Advance();
}
......
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