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.
/// 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);
private:
map<string, string> bindings_;
map<string, const Rule*> rules_;
- Env* parent_;
+ BindingEnv* parent_;
};
#endif // NINJA_EVAL_ENV_H_
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.
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_ -