diff options
-rw-r--r-- | expression-test/expression_test_parser.cpp | 3 | ||||
-rw-r--r-- | platform/node/test/ignores.json | 4 | ||||
-rw-r--r-- | src/mbgl/style/expression/assertion.cpp | 6 | ||||
-rw-r--r-- | src/mbgl/style/expression/parsing_context.cpp | 66 | ||||
-rw-r--r-- | src/mbgl/text/shaping.cpp | 2 |
5 files changed, 44 insertions, 37 deletions
diff --git a/expression-test/expression_test_parser.cpp b/expression-test/expression_test_parser.cpp index 546a96b3e0..3b40eeb3b0 100644 --- a/expression-test/expression_test_parser.cpp +++ b/expression-test/expression_test_parser.cpp @@ -104,7 +104,8 @@ optional<Value> toValue(const JSValue& jsvalue) { style::expression::type::Type stringToType(const std::string& type) { using namespace style::expression; - if (type == "string"s || type == "number-format"s) { + if (type == "string"s || type == "number-format"s || + type == "image"s) { // TODO: replace once we implement image expressions return type::String; } else if (type == "number"s) { return type::Number; diff --git a/platform/node/test/ignores.json b/platform/node/test/ignores.json index 8da2905dbb..289f38be38 100644 --- a/platform/node/test/ignores.json +++ b/platform/node/test/ignores.json @@ -16,6 +16,10 @@ "expression-tests/legacy/interval/composite": "https://github.com/mapbox/mapbox-gl-native/issues/12747", "expression-tests/legacy/interval/composite-default": "https://github.com/mapbox/mapbox-gl-native/issues/12747", "expression-tests/legacy/interval/tokens-zoom": "https://github.com/mapbox/mapbox-gl-native/issues/12747", + "expression-tests/image/basic": "https://github.com/mapbox/mapbox-gl-native/issues/15800", + "expression-tests/image/compound": "https://github.com/mapbox/mapbox-gl-native/issues/15800", + "expression-tests/image/coalesce": "https://github.com/mapbox/mapbox-gl-native/issues/15800", + "expression-tests/image/implicit-assert": "https://github.com/mapbox/mapbox-gl-native/issues/15800", "query-tests/geometry/multilinestring": "needs investigation", "query-tests/geometry/multipolygon": "needs investigation", "query-tests/geometry/polygon": "needs investigation", diff --git a/src/mbgl/style/expression/assertion.cpp b/src/mbgl/style/expression/assertion.cpp index 8e5a8b555d..17f8925511 100644 --- a/src/mbgl/style/expression/assertion.cpp +++ b/src/mbgl/style/expression/assertion.cpp @@ -16,12 +16,12 @@ Assertion::Assertion(type::Type type_, std::vector<std::unique_ptr<Expression>> } ParseResult Assertion::parse(const Convertible& value, ParsingContext& ctx) { - static std::unordered_map<std::string, type::Type> types { + static std::unordered_map<std::string, type::Type> types{ {"string", type::String}, + {"image", type::String}, // TODO: replace once we implement image expressions {"number", type::Number}, {"boolean", type::Boolean}, - {"object", type::Object} - }; + {"object", type::Object}}; std::size_t length = arrayLength(value); diff --git a/src/mbgl/style/expression/parsing_context.cpp b/src/mbgl/style/expression/parsing_context.cpp index 6ce3a9bfaa..699190608b 100644 --- a/src/mbgl/style/expression/parsing_context.cpp +++ b/src/mbgl/style/expression/parsing_context.cpp @@ -100,38 +100,40 @@ ParseResult ParsingContext::parse(const Convertible& value, std::size_t index_, } using ParseFunction = ParseResult (*)(const conversion::Convertible&, ParsingContext&); -MAPBOX_ETERNAL_CONSTEXPR const auto expressionRegistry = mapbox::eternal::hash_map<mapbox::eternal::string, ParseFunction>({ - {"==", parseComparison}, - {"!=", parseComparison}, - {">", parseComparison}, - {"<", parseComparison}, - {">=", parseComparison}, - {"<=", parseComparison}, - {"all", All::parse}, - {"any", Any::parse}, - {"array", Assertion::parse}, - {"at", At::parse}, - {"boolean", Assertion::parse}, - {"case", Case::parse}, - {"coalesce", Coalesce::parse}, - {"collator", CollatorExpression::parse}, - {"format", FormatExpression::parse}, - {"interpolate", parseInterpolate}, - {"length", Length::parse}, - {"let", Let::parse}, - {"literal", Literal::parse}, - {"match", parseMatch}, - {"number", Assertion::parse}, - {"number-format", NumberFormat::parse}, - {"object", Assertion::parse}, - {"step", Step::parse}, - {"string", Assertion::parse}, - {"to-boolean", Coercion::parse}, - {"to-color", Coercion::parse}, - {"to-number", Coercion::parse}, - {"to-string", Coercion::parse}, - {"var", Var::parse}, -}); +MAPBOX_ETERNAL_CONSTEXPR const auto expressionRegistry = + mapbox::eternal::hash_map<mapbox::eternal::string, ParseFunction>({ + {"==", parseComparison}, + {"!=", parseComparison}, + {">", parseComparison}, + {"<", parseComparison}, + {">=", parseComparison}, + {"<=", parseComparison}, + {"all", All::parse}, + {"any", Any::parse}, + {"array", Assertion::parse}, + {"at", At::parse}, + {"boolean", Assertion::parse}, + {"case", Case::parse}, + {"coalesce", Coalesce::parse}, + {"collator", CollatorExpression::parse}, + {"format", FormatExpression::parse}, + {"image", Assertion::parse}, // TODO: replace once we implement image expressions + {"interpolate", parseInterpolate}, + {"length", Length::parse}, + {"let", Let::parse}, + {"literal", Literal::parse}, + {"match", parseMatch}, + {"number", Assertion::parse}, + {"number-format", NumberFormat::parse}, + {"object", Assertion::parse}, + {"step", Step::parse}, + {"string", Assertion::parse}, + {"to-boolean", Coercion::parse}, + {"to-color", Coercion::parse}, + {"to-number", Coercion::parse}, + {"to-string", Coercion::parse}, + {"var", Var::parse}, + }); bool isExpression(const std::string& name) { return expressionRegistry.contains(name.c_str()); diff --git a/src/mbgl/text/shaping.cpp b/src/mbgl/text/shaping.cpp index d6d9a3d34e..4ae9d0cf20 100644 --- a/src/mbgl/text/shaping.cpp +++ b/src/mbgl/text/shaping.cpp @@ -32,7 +32,7 @@ AnchorAlignment AnchorAlignment::getAnchorAlignment(style::SymbolAnchorType anch result.horizontalAlign = 0.0f; break; default: - break; + break; } switch (anchor) { |