summaryrefslogtreecommitdiffstats
path: root/src/eval_env.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/eval_env.cc')
-rw-r--r--src/eval_env.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/eval_env.cc b/src/eval_env.cc
index 57c20c6..81a8765 100644
--- a/src/eval_env.cc
+++ b/src/eval_env.cc
@@ -38,14 +38,17 @@ string EvalString::Evaluate(Env* env) const {
return result;
}
-void EvalString::Add(TokenType type, StringPiece text) {
+void EvalString::AddText(StringPiece text) {
// Add it to the end of an existing RAW token if possible.
- if (type == RAW && !parsed_.empty() && parsed_.back().second == RAW) {
+ if (!parsed_.empty() && parsed_.back().second == RAW) {
parsed_.back().first.append(text.str_, text.len_);
} else {
- parsed_.push_back(make_pair(text.AsString(), type));
+ parsed_.push_back(make_pair(text.AsString(), RAW));
}
}
+void EvalString::AddSpecial(StringPiece text) {
+ parsed_.push_back(make_pair(text.AsString(), SPECIAL));
+}
string EvalString::Serialize() const {
string result;