18 map<string, string>::iterator i =
bindings_.find(var);
33 map<string, string>::iterator i =
bindings_.find(var);
48 for (TokenList::const_iterator i = parsed_.begin(); i != parsed_.end(); ++i) {
50 result.append(i->first);
59 if (!parsed_.empty() && parsed_.back().second == RAW) {
60 parsed_.back().first.append(text.
str_, text.
len_);
62 parsed_.push_back(make_pair(text.
AsString(), RAW));
66 parsed_.push_back(make_pair(text.
AsString(), SPECIAL));
71 for (TokenList::const_iterator i = parsed_.begin();
72 i != parsed_.end(); ++i) {
74 if (i->second == SPECIAL)
76 result.append(i->first);
map< string, string > bindings_
StringPiece represents a slice of a string whose memory is managed externally.
string AsString() const
Convert the slice into a full-fledged std::string, copying the data into a new string.
void AddSpecial(StringPiece text)
string Serialize() const
Construct a human-readable representation of the parsed state, for use in tests.
virtual string LookupVariable(const string &var)=0
virtual string LookupVariable(const string &var)
string LookupWithFallback(const string &var, const EvalString *eval, Env *env)
This is tricky.
void AddBinding(const string &key, const string &val)
void AddText(StringPiece text)
string Evaluate(Env *env) const
A tokenized string that contains variable references.
An interface for a scope for variable (e.g. "$foo") lookups.