diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2019-10-14 15:15:54 +0200 |
---|---|---|
committer | Konstantin Käfer <mail@kkaefer.com> | 2019-10-14 18:46:12 +0200 |
commit | 9cac122c5cf6404b9c8cdb52f130f7386a273241 (patch) | |
tree | 35c94fa8e23c030aa064a5e696f6c5cc9e545b10 /src | |
parent | 8206ce0e024a082f6979ce66f65909cb451e9d71 (diff) | |
download | qtlocation-mapboxgl-9cac122c5cf6404b9c8cdb52f130f7386a273241.tar.gz |
[core] map image type to string until we have a dedicated implementation
Diffstat (limited to 'src')
-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 |
3 files changed, 38 insertions, 36 deletions
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) { |