mirror of https://github.com/Icinga/icinga2.git
parent
0683fca535
commit
41d0dde52e
|
@ -475,7 +475,8 @@ Value AExpression::FunctionWrapper(const std::vector<Value>& arguments, const Ar
|
|||
for (int i = 0; i < std::min(arguments.size(), funcargs->GetLength()); i++)
|
||||
locals->Set(funcargs->Get(i), arguments[i]);
|
||||
|
||||
return expr->Evaluate(locals);
|
||||
expr->Evaluate(locals);
|
||||
return locals->Get("__result");
|
||||
}
|
||||
|
||||
Value AExpression::OpFunction(const AExpression* expr, const Dictionary::Ptr& locals)
|
||||
|
|
|
@ -781,8 +781,12 @@ rterm: T_STRING
|
|||
|
||||
arr->Add(Empty);
|
||||
|
||||
arr->Add(*$4);
|
||||
Array::Ptr arrex = make_shared<Array>();
|
||||
arrex->Add(make_shared<AExpression>(&AExpression::OpSet, make_shared<AExpression>(&AExpression::OpLiteral, "__result", @4), *$4, @4));
|
||||
delete $4;
|
||||
AExpression::Ptr aexpr = make_shared<AExpression>(&AExpression::OpDict, arrex, true, @4);
|
||||
|
||||
arr->Add(aexpr);
|
||||
|
||||
$$ = new Value(make_shared<AExpression>(&AExpression::OpFunction, arr, Array::Ptr($2), DebugInfoRange(@1, @4)));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue