Lines Matching refs:err
55 Value AccessorNode::Execute(Scope* scope, Err* err) const {
56 Value index_value = index_->Execute(scope, err);
57 if (err->has_error())
59 if (!index_value.VerifyTypeIs(Value::INTEGER, err))
64 *err = MakeErrorDescribing("Undefined identifier.");
67 if (!base_value->VerifyTypeIs(Value::LIST, err))
72 *err = Err(index_->GetRange(), "Negative array subscript.",
78 *err = Err(index_->GetRange(), "Array subscript out of range.",
98 Err AccessorNode::MakeErrorDescribing(const std::string& msg,
100 return Err(GetRange(), msg, help);
121 Value BinaryOpNode::Execute(Scope* scope, Err* err) const {
122 return ExecuteBinaryOperator(scope, this, left_.get(), right_.get(), err);
129 Err BinaryOpNode::MakeErrorDescribing(const std::string& msg,
131 return Err(op_, msg, help);
156 Value BlockNode::Execute(Scope* containing_scope, Err* err) const {
159 Value ret = ExecuteBlockInScope(&our_scope, err);
160 if (err->has_error())
164 //our_scope.CheckForUnusedVars(err);
167 return ExecuteBlockInScope(containing_scope, err);
177 Err BlockNode::MakeErrorDescribing(const std::string& msg,
180 return Err(*begin_token_, msg, help);
182 return Err(Location(NULL, 1, 1), msg, help);
191 Value BlockNode::ExecuteBlockInScope(Scope* our_scope, Err* err) const {
192 for (size_t i = 0; i < statements_.size() && !err->has_error(); i++) {
197 *err = cur->MakeErrorDescribing(
202 cur->Execute(our_scope, err);
219 Value ConditionNode::Execute(Scope* scope, Err* err) const {
220 Value condition_result = condition_->Execute(scope, err);
221 if (err->has_error())
224 *err = condition_->MakeErrorDescribing(
227 err->AppendRange(if_token_.range());
232 if_true_->ExecuteBlockInScope(scope, err);
240 if_false_block->ExecuteBlockInScope(scope, err);
242 if_false_->Execute(scope, err);
254 Err ConditionNode::MakeErrorDescribing(const std::string& msg,
256 return Err(if_token_, msg, help);
279 Value FunctionCallNode::Execute(Scope* scope, Err* err) const {
280 Value args = args_->Execute(scope, err);
281 if (err->has_error())
284 err);
293 Err FunctionCallNode::MakeErrorDescribing(const std::string& msg,
295 return Err(function_, msg, help);
320 Value IdentifierNode::Execute(Scope* scope, Err* err) const {
323 *err = MakeErrorDescribing("Undefined identifier");
333 Err IdentifierNode::MakeErrorDescribing(const std::string& msg,
335 return Err(value_, msg, help);
355 Value ListNode::Execute(Scope* scope, Err* err) const {
362 results[i] = cur->Execute(scope, err);
363 if (err->has_error())
366 *err = cur->MakeErrorDescribing(
379 Err ListNode::MakeErrorDescribing(const std::string& msg,
381 return Err(begin_token_, msg, help);
405 Value LiteralNode::Execute(Scope* scope, Err* err) const {
410 *err = MakeErrorDescribing("This does not look like an integer");
420 ExpandStringLiteral(scope, value_, &v, err);
433 Err LiteralNode::MakeErrorDescribing(const std::string& msg,
435 return Err(value_, msg, help);
454 Value UnaryOpNode::Execute(Scope* scope, Err* err) const {
455 Value operand_value = operand_->Execute(scope, err);
456 if (err->has_error())
458 return ExecuteUnaryOperator(scope, this, operand_value, err);
465 Err UnaryOpNode::MakeErrorDescribing(const std::string& msg,
467 return Err(op_, msg, help);