mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-25 22:54:57 +02:00
parent
b016003eb5
commit
a94b26ff47
@ -41,6 +41,10 @@ struct DebugInfo
|
|||||||
|
|
||||||
int LastLine;
|
int LastLine;
|
||||||
int LastColumn;
|
int LastColumn;
|
||||||
|
|
||||||
|
DebugInfo(void)
|
||||||
|
: FirstLine(0), FirstColumn(0), LastLine(0), LastColumn(0)
|
||||||
|
{ }
|
||||||
};
|
};
|
||||||
|
|
||||||
I2_BASE_API std::ostream& operator<<(std::ostream& out, const DebugInfo& val);
|
I2_BASE_API std::ostream& operator<<(std::ostream& out, const DebugInfo& val);
|
||||||
|
@ -89,7 +89,7 @@ const DebugInfo& DebuggableExpression::GetDebugInfo(void) const
|
|||||||
|
|
||||||
Value VariableExpression::DoEvaluate(VMFrame& frame, DebugHint *dhint) const
|
Value VariableExpression::DoEvaluate(VMFrame& frame, DebugHint *dhint) const
|
||||||
{
|
{
|
||||||
return VMOps::Variable(frame, m_Variable);
|
return VMOps::Variable(frame, m_Variable, GetDebugInfo());
|
||||||
}
|
}
|
||||||
|
|
||||||
Value NegateExpression::DoEvaluate(VMFrame& frame, DebugHint *dhint) const
|
Value NegateExpression::DoEvaluate(VMFrame& frame, DebugHint *dhint) const
|
||||||
@ -419,7 +419,7 @@ Value ReturnExpression::DoEvaluate(VMFrame& frame, DebugHint *dhint) const
|
|||||||
|
|
||||||
Value IndexerExpression::DoEvaluate(VMFrame& frame, DebugHint *dhint) const
|
Value IndexerExpression::DoEvaluate(VMFrame& frame, DebugHint *dhint) const
|
||||||
{
|
{
|
||||||
return VMOps::Indexer(frame, m_Indexer);
|
return VMOps::Indexer(frame, m_Indexer, GetDebugInfo());
|
||||||
}
|
}
|
||||||
|
|
||||||
Value ImportExpression::DoEvaluate(VMFrame& frame, DebugHint *dhint) const
|
Value ImportExpression::DoEvaluate(VMFrame& frame, DebugHint *dhint) const
|
||||||
|
@ -45,7 +45,7 @@ namespace icinga
|
|||||||
class VMOps
|
class VMOps
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static inline Value Variable(VMFrame& frame, const String& name)
|
static inline Value Variable(VMFrame& frame, const String& name, const DebugInfo& debugInfo = DebugInfo())
|
||||||
{
|
{
|
||||||
if (name == "this")
|
if (name == "this")
|
||||||
return frame.Self;
|
return frame.Self;
|
||||||
@ -53,7 +53,7 @@ public:
|
|||||||
if (frame.Locals && frame.Locals->Contains(name))
|
if (frame.Locals && frame.Locals->Contains(name))
|
||||||
return frame.Locals->Get(name);
|
return frame.Locals->Get(name);
|
||||||
else if (frame.Locals != frame.Self && HasField(frame.Self, name))
|
else if (frame.Locals != frame.Self && HasField(frame.Self, name))
|
||||||
return GetField(frame.Self, name);
|
return GetField(frame.Self, name, debugInfo);
|
||||||
else
|
else
|
||||||
return ScriptVariable::Get(name);
|
return ScriptVariable::Get(name);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user