summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorNico Weber <nicolasweber@gmx.de>2015-03-18 16:35:57 (GMT)
committerNico Weber <nicolasweber@gmx.de>2015-03-18 16:35:57 (GMT)
commitffa1beb78feee904acefce74a6bba2e4cc5416cb (patch)
tree67296a17e89ddbf0ddf8a3c2fa148bd13712eb06 /src
parent717619a260633ca0e7c9eb2366130fc06ebacfff (diff)
downloadNinja-ffa1beb78feee904acefce74a6bba2e4cc5416cb.zip
Ninja-ffa1beb78feee904acefce74a6bba2e4cc5416cb.tar.gz
Ninja-ffa1beb78feee904acefce74a6bba2e4cc5416cb.tar.bz2
Env should only be about variables. No behavior change.
Diffstat (limited to 'src')
-rw-r--r--src/eval_env.h5
-rw-r--r--src/graph.cc5
2 files changed, 2 insertions, 8 deletions
diff --git a/src/eval_env.h b/src/eval_env.h
index 7b9bdf5..250fa55 100644
--- a/src/eval_env.h
+++ b/src/eval_env.h
@@ -28,7 +28,6 @@ struct Rule;
struct Env {
virtual ~Env() {}
virtual string LookupVariable(const string& var) = 0;
- virtual const Rule* LookupRule(const string& rule_name) = 0;
};
/// A tokenized string that contains variable references.
@@ -77,7 +76,7 @@ struct Rule {
/// as well as a pointer to a parent scope.
struct BindingEnv : public Env {
BindingEnv() : parent_(NULL) {}
- explicit BindingEnv(Env* parent) : parent_(parent) {}
+ explicit BindingEnv(BindingEnv* parent) : parent_(parent) {}
virtual ~BindingEnv() {}
virtual string LookupVariable(const string& var);
@@ -100,7 +99,7 @@ struct BindingEnv : public Env {
private:
map<string, string> bindings_;
map<string, const Rule*> rules_;
- Env* parent_;
+ BindingEnv* parent_;
};
#endif // NINJA_EVAL_ENV_H_
diff --git a/src/graph.cc b/src/graph.cc
index 76c4e9a..e3253fd 100644
--- a/src/graph.cc
+++ b/src/graph.cc
@@ -207,7 +207,6 @@ struct EdgeEnv : public Env {
EdgeEnv(Edge* edge, EscapeKind escape)
: edge_(edge), escape_in_out_(escape) {}
virtual string LookupVariable(const string& var);
- virtual const Rule* LookupRule(const string& rule_name);
/// Given a span of Nodes, construct a list of paths suitable for a command
/// line.
@@ -219,10 +218,6 @@ struct EdgeEnv : public Env {
EscapeKind escape_in_out_;
};
-const Rule* EdgeEnv::LookupRule(const string& rule_name) {
- return NULL;
-}
-
string EdgeEnv::LookupVariable(const string& var) {
if (var == "in" || var == "in_newline") {
int explicit_deps_count = edge_->inputs_.size() - edge_->implicit_deps_ -