summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Iannucci <robbie@rail.com>2012-10-01 20:07:42 (GMT)
committerRobert Iannucci <robbie@rail.com>2012-11-10 05:55:01 (GMT)
commit6a2f66d3ec8d8f2827c36b61dc64402c6ee5c8c2 (patch)
tree32274bb85ee4956a41467b1d2a59532c364432d9
parenta84d93cde00febb44be7918f6a44dc658d83d155 (diff)
downloadNinja-6a2f66d3ec8d8f2827c36b61dc64402c6ee5c8c2.zip
Ninja-6a2f66d3ec8d8f2827c36b61dc64402c6ee5c8c2.tar.gz
Ninja-6a2f66d3ec8d8f2827c36b61dc64402c6ee5c8c2.tar.bz2
begin rationalizing platform for both parsers
-rw-r--r--src/manifest_parser.cc12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/manifest_parser.cc b/src/manifest_parser.cc
index 9ab973f..271b841 100644
--- a/src/manifest_parser.cc
+++ b/src/manifest_parser.cc
@@ -107,8 +107,7 @@ bool ManifestParser::ParsePool(string* err) {
if (state_->LookupPool(name) != NULL)
return lexer_.Error("duplicate pool '" + name + "'", err);
- Pool* pool = new Pool(name);
- bool set_depth = false;
+ int depth = -1;
while (lexer_.PeekToken(Lexer::INDENT)) {
string key;
@@ -118,19 +117,18 @@ bool ManifestParser::ParsePool(string* err) {
if (key == "depth") {
string depth_string = value.Evaluate(env_);
- pool->depth_ = atol(depth_string.c_str());
- if (pool->depth() <= 0)
+ depth = atol(depth_string.c_str());
+ if (depth < 0)
return lexer_.Error("invalid pool depth", err);
- set_depth = true;
} else {
return lexer_.Error("unexpected variable '" + key + "'", err);
}
}
- if (!set_depth)
+ if (depth < 0)
return lexer_.Error("expected 'depth =' line", err);
- state_->AddPool(pool);
+ state_->AddPool(new Pool(name, depth));
return true;
}