diff options
author | Fabian Guerra <fabian.guerra@mapbox.com> | 2018-04-23 10:44:02 -0400 |
---|---|---|
committer | Fabian Guerra <fabian.guerra@mapbox.com> | 2018-04-23 10:44:02 -0400 |
commit | e08b6fe87f5824ab05a4cc67d9a76af5bb5ddd3b (patch) | |
tree | 886e10260bfa044f62943186ec837b9ccd02934c /include/mbgl/style/expression/parsing_context.hpp | |
parent | 2bb785dad2489d04db179fa9cf65514640db0a96 (diff) | |
parent | a45670cfb5752866b9c8130024a313944684c2db (diff) | |
download | qtlocation-mapboxgl-upstream/fabian-merge-v4.0.0.tar.gz |
Merge branch 'release-boba' into masterupstream/fabian-merge-v4.0.0
# Conflicts:
# circle.yml
# include/mbgl/style/expression/let.hpp
# platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/geometry/LatLngBounds.java
# platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapGestureDetector.java
# platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapKeyListener.java
# platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapView.java
# platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapboxMap.java
# platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/Projection.java
# platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/Transform.java
# platform/android/MapboxGLAndroidSDK/src/test/java/com/mapbox/mapboxsdk/geometry/LatLngBoundsTest.java
# platform/android/MapboxGLAndroidSDKTestApp/src/main/AndroidManifest.xml
# platform/android/gradle/dependencies.gradle
# platform/android/src/example_custom_layer.cpp
# platform/android/src/geojson/point.cpp
# platform/darwin/src/NSPredicate+MGLAdditions.mm
# platform/darwin/test/MGLExpressionTests.mm
# platform/ios/Mapbox-iOS-SDK-nightly-dynamic.podspec
# platform/ios/Mapbox-iOS-SDK-symbols.podspec
# platform/ios/Mapbox-iOS-SDK.podspec
# platform/ios/app/MBXViewController.m
# src/mbgl/renderer/layers/render_custom_layer.cpp
# src/mbgl/style/conversion/filter.cpp
# src/mbgl/style/expression/interpolate.cpp
# src/mbgl/style/expression/value.cpp
# test/style/filter.test.cpp
Diffstat (limited to 'include/mbgl/style/expression/parsing_context.hpp')
-rw-r--r-- | include/mbgl/style/expression/parsing_context.hpp | 34 |
1 files changed, 25 insertions, 9 deletions
diff --git a/include/mbgl/style/expression/parsing_context.hpp b/include/mbgl/style/expression/parsing_context.hpp index f92a4c95ea..c19974a4f7 100644 --- a/include/mbgl/style/expression/parsing_context.hpp +++ b/include/mbgl/style/expression/parsing_context.hpp @@ -55,7 +55,7 @@ class ParsingContext { public: ParsingContext() : errors(std::make_shared<std::vector<ParsingError>>()) {} ParsingContext(std::string key_) : key(std::move(key_)), errors(std::make_shared<std::vector<ParsingError>>()) {} - explicit ParsingContext(optional<type::Type> expected_) + explicit ParsingContext(type::Type expected_) : expected(std::move(expected_)), errors(std::make_shared<std::vector<ParsingError>>()) {} @@ -67,6 +67,7 @@ public: std::string getKey() const { return key; } optional<type::Type> getExpected() const { return expected; } const std::vector<ParsingError>& getErrors() const { return *errors; } + const std::string getCombinedErrors() const; enum TypeAnnotationOption { includeTypeAnnotations, @@ -74,16 +75,21 @@ public: }; /* - Parse the given style-spec JSON value into an Expression object. - Specifically, this function is responsible for determining the expression - type (either Literal, or the one named in value[0]) and dispatching to the - appropriate ParseXxxx::parse(const V&, ParsingContext) method. + Parse the given style-spec JSON value as an expression. */ - ParseResult parse(const mbgl::style::conversion::Convertible& value, - TypeAnnotationOption typeAnnotationOption = includeTypeAnnotations); + ParseResult parseExpression(const mbgl::style::conversion::Convertible& value, + TypeAnnotationOption typeAnnotationOption = includeTypeAnnotations); /* - Parse a child expression. + Parse the given style-spec JSON value as an expression intended to be used + in a layout or paint property. This entails checking additional constraints + that exist in that context but not, e.g., for filters. + */ + ParseResult parseLayerPropertyExpression(const mbgl::style::conversion::Convertible& value, + TypeAnnotationOption typeAnnotationOption = includeTypeAnnotations); + + /* + Parse a child expression. For use by individual Expression::parse() methods. */ ParseResult parse(const mbgl::style::conversion::Convertible&, std::size_t, @@ -91,7 +97,7 @@ public: TypeAnnotationOption typeAnnotationOption = includeTypeAnnotations); /* - Parse a child expression. + Parse a child expression. For use by individual Expression::parse() methods. */ ParseResult parse(const mbgl::style::conversion::Convertible&, std::size_t index, @@ -141,6 +147,16 @@ private: errors(std::move(errors_)) {} + + /* + Parse the given style-spec JSON value into an Expression object. + Specifically, this function is responsible for determining the expression + type (either Literal, or the one named in value[0]) and dispatching to the + appropriate ParseXxxx::parse(const V&, ParsingContext) method. + */ + ParseResult parse(const mbgl::style::conversion::Convertible& value, + TypeAnnotationOption typeAnnotationOption = includeTypeAnnotations); + std::string key; optional<type::Type> expected; std::shared_ptr<detail::Scope> scope; |