[core] Introduce "collator" expressions

Cross platform parsing and evaluation code.
This commit is contained in:
Chris Loer
2018-06-29 15:56:37 -07:00
committed by Chris Loer
parent b9d3ecc990
commit 9ff5d34ef2
15 changed files with 297 additions and 16 deletions

View File

@@ -1,4 +1,6 @@
#include <mbgl/style/expression/is_constant.hpp>
#include <mbgl/style/expression/collator_expression.hpp>
namespace mbgl {
namespace style {
@@ -25,6 +27,13 @@ bool isFeatureConstant(const Expression& expression) {
return false;
}
}
if (dynamic_cast<const CollatorExpression*>(&expression)) {
// Although the results of a Collator expression with fixed arguments
// generally shouldn't change between executions, we can't serialize them
// as constant expressions because results change based on environment.
return false;
}
bool featureConstant = true;
expression.eachChild([&](const Expression& e) {