summaryrefslogtreecommitdiff
path: root/src/mbgl/style/conversion/filter.cpp
diff options
context:
space:
mode:
authorAnand Thakker <anandthakker@users.noreply.github.com>2018-04-12 16:02:48 -0400
committerGitHub <noreply@github.com>2018-04-12 16:02:48 -0400
commit352d63d2ce98286cd854b11e85d66440501a6fd0 (patch)
tree08a6cc5140ddf044590ce82a44b7f2e0a920638c /src/mbgl/style/conversion/filter.cpp
parent646cbc98ddaa8f6afe84c96888c877628bf405ca (diff)
downloadqtlocation-mapboxgl-352d63d2ce98286cd854b11e85d66440501a6fd0.tar.gz
Don't enforce ["zoom"] constraints for filters (#11672)
* Don't enforce ["zoom"] constraints for filters Fixes #11594 * Add a couple of comments * Fix ambiguous constructor call * ParsingContext(optional<Type>) => ParsingContext(Type)
Diffstat (limited to 'src/mbgl/style/conversion/filter.cpp')
-rw-r--r--src/mbgl/style/conversion/filter.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/mbgl/style/conversion/filter.cpp b/src/mbgl/style/conversion/filter.cpp
index fba149da12..3c941945fd 100644
--- a/src/mbgl/style/conversion/filter.cpp
+++ b/src/mbgl/style/conversion/filter.cpp
@@ -2,7 +2,7 @@
#include <mbgl/util/geometry.hpp>
#include <mbgl/style/expression/expression.hpp>
#include <mbgl/style/expression/type.hpp>
-#include <mbgl/style/conversion/expression.hpp>
+#include <mbgl/style/expression/parsing_context.hpp>
namespace mbgl {
namespace style {
@@ -236,10 +236,13 @@ optional<Filter> convertCompoundFilter(const Convertible& value, Error& error) {
}
optional<Filter> convertExpressionFilter(const Convertible& value, Error& error) {
- optional<std::unique_ptr<Expression>> expression = convert<std::unique_ptr<Expression>>(value, error, expression::type::Boolean);
+ expression::ParsingContext ctx(expression::type::Boolean);
+ expression::ParseResult expression = ctx.parseExpression(value);
if (!expression) {
+ error = { ctx.getCombinedErrors() };
return {};
}
+
return { ExpressionFilter { std::move(*expression) } };
}