diff options
author | Marius Kintel <marius@kintel.net> | 2013-04-18 22:34:14 (GMT) |
---|---|---|
committer | Marius Kintel <marius@kintel.net> | 2013-04-18 22:34:14 (GMT) |
commit | 58bd9c9e3f4454d055bf51d63463a9965a9dcbd7 (patch) | |
tree | 732cd423858685365a4115d44a52f85ae90866a1 /src/expr.cc | |
parent | 73c2a45af6afca253159d2cf9c1ecf5747f0217e (diff) |
Cleaned up argument list handling, related to #116
Diffstat (limited to 'src/expr.cc')
-rw-r--r-- | src/expr.cc | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/expr.cc b/src/expr.cc index 1d7b440..7a8180f 100644 --- a/src/expr.cc +++ b/src/expr.cc @@ -128,9 +128,9 @@ Value Expression::evaluate(const Context *context) const } if (this->type == "F") { EvalContext c(context); - for (size_t i=0; i < this->children.size(); i++) { - c.eval_arguments.push_back(std::make_pair(this->call_argnames[i], - this->children[i]->evaluate(context))); + for (size_t i=0; i < this->call_arguments.size(); i++) { + c.eval_arguments.push_back(std::make_pair(this->call_arguments[i].first, + this->call_arguments[i].second->evaluate(context))); } // Value::VectorType argvalues; // std::transform(this->children.begin(), this->children.end(), @@ -183,10 +183,11 @@ std::string Expression::toString() const } else if (this->type == "F") { stream << this->call_funcname << "("; - for (size_t i=0; i < this->children.size(); i++) { + for (size_t i=0; i < this->call_arguments.size(); i++) { + const Assignment &arg = this->call_arguments[i]; if (i > 0) stream << ", "; - if (!this->call_argnames[i].empty()) stream << this->call_argnames[i] << " = "; - stream << *this->children[i]; + if (!arg.first.empty()) stream << arg.first << " = "; + stream << *arg.second; } stream << ")"; } |