mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-26 23:24:09 +02:00
parent
77806b9de7
commit
b9831f0be4
@ -641,6 +641,18 @@ lterm: type
|
|||||||
$$ = new SetExpression(MakeIndexer(ScopeGlobal, $2), OpSetLiteral, $4);
|
$$ = new SetExpression(MakeIndexer(ScopeGlobal, $2), OpSetLiteral, $4);
|
||||||
free($2);
|
free($2);
|
||||||
}
|
}
|
||||||
|
| T_VAR rterm
|
||||||
|
{
|
||||||
|
Expression *expr = $2;
|
||||||
|
BindToScope(expr, ScopeLocal);
|
||||||
|
$$ = new SetExpression(expr, OpSetLiteral, MakeLiteral(), DebugInfoRange(@1, @2));
|
||||||
|
}
|
||||||
|
| T_VAR rterm combined_set_op rterm
|
||||||
|
{
|
||||||
|
Expression *expr = $2;
|
||||||
|
BindToScope(expr, ScopeLocal);
|
||||||
|
$$ = new SetExpression(expr, $3, $4, DebugInfoRange(@1, @4));
|
||||||
|
}
|
||||||
| rterm
|
| rterm
|
||||||
{
|
{
|
||||||
$$ = $1;
|
$$ = $1;
|
||||||
@ -752,18 +764,6 @@ rterm: T_STRING
|
|||||||
{
|
{
|
||||||
$$ = new GetScopeExpression(ScopeThis);
|
$$ = new GetScopeExpression(ScopeThis);
|
||||||
}
|
}
|
||||||
| T_VAR rterm
|
|
||||||
{
|
|
||||||
Expression *expr = $2;
|
|
||||||
BindToScope(expr, ScopeLocal);
|
|
||||||
$$ = new SetExpression(expr, OpSetLiteral, MakeLiteral(), DebugInfoRange(@1, @2));
|
|
||||||
}
|
|
||||||
| T_VAR rterm combined_set_op rterm
|
|
||||||
{
|
|
||||||
Expression *expr = $2;
|
|
||||||
BindToScope(expr, ScopeLocal);
|
|
||||||
$$ = new SetExpression(expr, $3, $4, DebugInfoRange(@1, @4));
|
|
||||||
}
|
|
||||||
| rterm_array
|
| rterm_array
|
||||||
{
|
{
|
||||||
$$ = $1;
|
$$ = $1;
|
||||||
|
@ -299,6 +299,14 @@ BOOST_AUTO_TEST_CASE(advanced)
|
|||||||
expr = ConfigCompiler::CompileText("<test>", "3 = 3");
|
expr = ConfigCompiler::CompileText("<test>", "3 = 3");
|
||||||
BOOST_CHECK_THROW(expr->Evaluate(frame), ScriptError);
|
BOOST_CHECK_THROW(expr->Evaluate(frame), ScriptError);
|
||||||
delete expr;
|
delete expr;
|
||||||
|
|
||||||
|
expr = ConfigCompiler::CompileText("<test>", "var e; e");
|
||||||
|
BOOST_CHECK(expr->Evaluate(frame).IsEmpty());
|
||||||
|
delete expr;
|
||||||
|
|
||||||
|
expr = ConfigCompiler::CompileText("<test>", "var e = 3; e");
|
||||||
|
BOOST_CHECK(expr->Evaluate(frame) == 3);
|
||||||
|
delete expr;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOST_AUTO_TEST_SUITE_END()
|
BOOST_AUTO_TEST_SUITE_END()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user