diff --git a/lib/config/config_parser.yy b/lib/config/config_parser.yy index a3a22182d..a0f83b663 100644 --- a/lib/config/config_parser.yy +++ b/lib/config/config_parser.yy @@ -564,7 +564,7 @@ lterm: T_LIBRARY rterm } | T_THROW rterm { - $$ = new ThrowExpression($2, @$); + $$ = new ThrowExpression($2, false, @$); } | rterm_side_effect ; diff --git a/lib/config/configcompiler.cpp b/lib/config/configcompiler.cpp index 688f50681..9aed686b3 100644 --- a/lib/config/configcompiler.cpp +++ b/lib/config/configcompiler.cpp @@ -242,9 +242,9 @@ Expression *ConfigCompiler::CompileStream(const String& path, try { return ctx.Compile(); } 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) { - return new ThrowExpression(MakeLiteral(DiagnosticInformation(ex))); + return new ThrowExpression(MakeLiteral(DiagnosticInformation(ex)), false); } } diff --git a/lib/config/expression.cpp b/lib/config/expression.cpp index 5290a9897..a2b15bc87 100644 --- a/lib/config/expression.cpp +++ b/lib/config/expression.cpp @@ -698,7 +698,7 @@ ExpressionResult ThrowExpression::DoEvaluate(ScriptFrame& frame, DebugHint *dhin ExpressionResult messageres = m_Message->Evaluate(frame); CHECK_RESULT(messageres); 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 diff --git a/lib/config/expression.hpp b/lib/config/expression.hpp index 130edf5a5..506c67c62 100644 --- a/lib/config/expression.hpp +++ b/lib/config/expression.hpp @@ -747,8 +747,8 @@ I2_CONFIG_API void BindToScope(Expression *& expr, ScopeSpecifier scopeSpec); class I2_CONFIG_API ThrowExpression : public DebuggableExpression { public: - ThrowExpression(Expression *message, const DebugInfo& debugInfo = DebugInfo()) - : DebuggableExpression(debugInfo), m_Message(message) + ThrowExpression(Expression *message, bool incompleteExpr, const DebugInfo& debugInfo = DebugInfo()) + : DebuggableExpression(debugInfo), m_Message(message), m_IncompleteExpr(incompleteExpr) { } ~ThrowExpression(void) @@ -761,6 +761,7 @@ protected: private: Expression *m_Message; + bool m_IncompleteExpr; }; class I2_CONFIG_API ImportExpression : public DebuggableExpression