diff options
author | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-05-15 19:41:58 +0000 |
---|---|---|
committer | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-05-15 19:41:58 +0000 |
commit | df15e82d8a474281b61904f0dad68d251f552201 (patch) | |
tree | a70e5feab08d37486b5f8ad308f1c2406a45449a /tools | |
parent | f1100b95d39b9667f5c0416f6348ad771cfd6266 (diff) | |
download | chromium_src-df15e82d8a474281b61904f0dad68d251f552201.zip chromium_src-df15e82d8a474281b61904f0dad68d251f552201.tar.gz chromium_src-df15e82d8a474281b61904f0dad68d251f552201.tar.bz2 |
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
Diffstat (limited to 'tools')
-rw-r--r-- | tools/gn/tokenizer.cc | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/tools/gn/tokenizer.cc b/tools/gn/tokenizer.cc index 556c8ee..c089006 100644 --- a/tools/gn/tokenizer.cc +++ b/tools/gn/tokenizer.cc @@ -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(); } |