diff options
author | Evan Martin <martine@danga.com> | 2011-05-23 16:26:16 (GMT) |
---|---|---|
committer | Evan Martin <martine@danga.com> | 2011-05-23 16:26:16 (GMT) |
commit | b2f8cb24f3a38fa15fb510072d2da46e05adbc00 (patch) | |
tree | 4c67a69d6c2097f9ebf125e905dcf4cb22283cda /src/parsers.cc | |
parent | 2bdd317515b574582467c8c284e4fdfa6c161f15 (diff) | |
download | Ninja-b2f8cb24f3a38fa15fb510072d2da46e05adbc00.zip Ninja-b2f8cb24f3a38fa15fb510072d2da46e05adbc00.tar.gz Ninja-b2f8cb24f3a38fa15fb510072d2da46e05adbc00.tar.bz2 |
show correct location for unexpected var error
Diffstat (limited to 'src/parsers.cc')
-rw-r--r-- | src/parsers.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/parsers.cc b/src/parsers.cc index 78d6164..3c392db 100644 --- a/src/parsers.cc +++ b/src/parsers.cc @@ -321,6 +321,8 @@ bool ManifestParser::ParseRule(string* err) { tokenizer_.ConsumeToken(); while (tokenizer_.PeekToken() != Token::OUTDENT) { + SourceLocation let_loc = tokenizer_.Location(); + string key, val; if (!ParseLet(&key, &val, false, err)) return false; @@ -338,7 +340,7 @@ bool ManifestParser::ParseRule(string* err) { } else { // Die on other keyvals for now; revisit if we want to add a // scope here. - return tokenizer_.Error("unexpected variable '" + key + "'", err); + return let_loc.Error("unexpected variable '" + key + "'", err); } } tokenizer_.ConsumeToken(); |