mirror of https://github.com/Icinga/icinga2.git
parent
b016003eb5
commit
a94b26ff47
|
@ -41,6 +41,10 @@ struct DebugInfo
|
|||
|
||||
int LastLine;
|
||||
int LastColumn;
|
||||
|
||||
DebugInfo(void)
|
||||
: FirstLine(0), FirstColumn(0), LastLine(0), LastColumn(0)
|
||||
{ }
|
||||
};
|
||||
|
||||
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
|
||||
{
|
||||
return VMOps::Variable(frame, m_Variable);
|
||||
return VMOps::Variable(frame, m_Variable, GetDebugInfo());
|
||||
}
|
||||
|
||||
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
|
||||
{
|
||||
return VMOps::Indexer(frame, m_Indexer);
|
||||
return VMOps::Indexer(frame, m_Indexer, GetDebugInfo());
|
||||
}
|
||||
|
||||
Value ImportExpression::DoEvaluate(VMFrame& frame, DebugHint *dhint) const
|
||||
|
|
|
@ -45,7 +45,7 @@ namespace icinga
|
|||
class VMOps
|
||||
{
|
||||
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")
|
||||
return frame.Self;
|
||||
|
@ -53,7 +53,7 @@ public:
|
|||
if (frame.Locals && frame.Locals->Contains(name))
|
||||
return frame.Locals->Get(name);
|
||||
else if (frame.Locals != frame.Self && HasField(frame.Self, name))
|
||||
return GetField(frame.Self, name);
|
||||
return GetField(frame.Self, name, debugInfo);
|
||||
else
|
||||
return ScriptVariable::Get(name);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue