From fd013286592726c7b8dc8121eeb16f72bec61cb4 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Fri, 12 Mar 2021 23:18:23 +0100 Subject: [PATCH] Fixed Expressions error message for multi-line expressions. --- src/tl/tl/tlExpression.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tl/tl/tlExpression.cc b/src/tl/tl/tlExpression.cc index ee7d5a031..a00dbefd1 100644 --- a/src/tl/tl/tlExpression.cc +++ b/src/tl/tl/tlExpression.cc @@ -104,7 +104,7 @@ ExpressionParserContext::where () const int line = 1; size_t col = 0; - for (size_t p = 0; p < len; ++p, ++col) { + for (size_t p = 0; p < pos; ++p) { if (text [p] == '\n') { ++line; col = 1; @@ -2044,7 +2044,7 @@ public: throw EvalError (tl::sprintf (tl::to_string (tr ("Not a valid object for a method call (not an object) - value is %s")), v->to_parsable_string ()), m_context); } } else { - throw EvalError (tl::sprintf (tl::to_string (tr ("Not a valid object for a method call (wrong type) - value is %1")), v->to_parsable_string ()), m_context); + throw EvalError (tl::sprintf (tl::to_string (tr ("Not a valid object for a method call (wrong type) - value is %s")), v->to_parsable_string ()), m_context); } tl::Variant o;