Fix: Line continuation is broken in 'icinga2 console'

fixes #10461
This commit is contained in:
Gunnar Beutner 2015-10-26 13:04:03 +01:00
parent dd77863910
commit 1ec20a1e8d
4 changed files with 7 additions and 6 deletions

View File

@ -564,7 +564,7 @@ lterm: T_LIBRARY rterm
} }
| T_THROW rterm | T_THROW rterm
{ {
$$ = new ThrowExpression($2, @$); $$ = new ThrowExpression($2, false, @$);
} }
| rterm_side_effect | rterm_side_effect
; ;

View File

@ -242,9 +242,9 @@ Expression *ConfigCompiler::CompileStream(const String& path,
try { try {
return ctx.Compile(); return ctx.Compile();
} catch (const ScriptError& ex) { } catch (const ScriptError& ex) {
return new ThrowExpression(MakeLiteral(ex.what()), ex.GetDebugInfo()); return new ThrowExpression(MakeLiteral(ex.what()), ex.IsIncompleteExpression(), ex.GetDebugInfo());
} catch (const std::exception& ex) { } catch (const std::exception& ex) {
return new ThrowExpression(MakeLiteral(DiagnosticInformation(ex))); return new ThrowExpression(MakeLiteral(DiagnosticInformation(ex)), false);
} }
} }

View File

@ -698,7 +698,7 @@ ExpressionResult ThrowExpression::DoEvaluate(ScriptFrame& frame, DebugHint *dhin
ExpressionResult messageres = m_Message->Evaluate(frame); ExpressionResult messageres = m_Message->Evaluate(frame);
CHECK_RESULT(messageres); CHECK_RESULT(messageres);
Value message = messageres.GetValue(); Value message = messageres.GetValue();
BOOST_THROW_EXCEPTION(ScriptError(message, m_DebugInfo)); BOOST_THROW_EXCEPTION(ScriptError(message, m_DebugInfo, m_IncompleteExpr));
} }
ExpressionResult ImportExpression::DoEvaluate(ScriptFrame& frame, DebugHint *dhint) const ExpressionResult ImportExpression::DoEvaluate(ScriptFrame& frame, DebugHint *dhint) const

View File

@ -747,8 +747,8 @@ I2_CONFIG_API void BindToScope(Expression *& expr, ScopeSpecifier scopeSpec);
class I2_CONFIG_API ThrowExpression : public DebuggableExpression class I2_CONFIG_API ThrowExpression : public DebuggableExpression
{ {
public: public:
ThrowExpression(Expression *message, const DebugInfo& debugInfo = DebugInfo()) ThrowExpression(Expression *message, bool incompleteExpr, const DebugInfo& debugInfo = DebugInfo())
: DebuggableExpression(debugInfo), m_Message(message) : DebuggableExpression(debugInfo), m_Message(message), m_IncompleteExpr(incompleteExpr)
{ } { }
~ThrowExpression(void) ~ThrowExpression(void)
@ -761,6 +761,7 @@ protected:
private: private:
Expression *m_Message; Expression *m_Message;
bool m_IncompleteExpr;
}; };
class I2_CONFIG_API ImportExpression : public DebuggableExpression class I2_CONFIG_API ImportExpression : public DebuggableExpression