summaryrefslogtreecommitdiff
path: root/src/mbgl/style/expression/case.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mbgl/style/expression/case.cpp')
-rw-r--r--src/mbgl/style/expression/case.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/mbgl/style/expression/case.cpp b/src/mbgl/style/expression/case.cpp
index 049f258606..295e694189 100644
--- a/src/mbgl/style/expression/case.cpp
+++ b/src/mbgl/style/expression/case.cpp
@@ -34,6 +34,19 @@ bool Case::operator==(const Expression& e) const {
return false;
}
+std::vector<optional<Value>> Case::possibleOutputs() const {
+ std::vector<optional<Value>> result;
+ for (const auto& branch : branches) {
+ for (auto& output : branch.second->possibleOutputs()) {
+ result.push_back(std::move(output));
+ }
+ }
+ for (auto& output : otherwise->possibleOutputs()) {
+ result.push_back(std::move(output));
+ }
+ return result;
+}
+
using namespace mbgl::style::conversion;
ParseResult Case::parse(const Convertible& value, ParsingContext& ctx) {
assert(isArray(value));