summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnand Thakker <github@anandthakker.net>2017-09-01 09:55:11 -0400
committerAnand Thakker <github@anandthakker.net>2017-10-13 12:50:51 -0400
commitb8c2c264f65a24abcae8481f7c280afafd346cee (patch)
treebbc0cd4468b51337c8e31ae88bc91e187f156dba
parentc47159bc03996a1e78d9014b330184ce3735d855 (diff)
downloadqtlocation-mapboxgl-b8c2c264f65a24abcae8481f7c280afafd346cee.tar.gz
snake case => kebab case
-rw-r--r--include/mbgl/style/function/convert.hpp2
-rw-r--r--src/mbgl/style/expression/compound_expression.cpp12
-rw-r--r--src/mbgl/style/function/expression.cpp2
3 files changed, 8 insertions, 8 deletions
diff --git a/include/mbgl/style/function/convert.hpp b/include/mbgl/style/function/convert.hpp
index f77bee4465..3bc5723c6a 100644
--- a/include/mbgl/style/function/convert.hpp
+++ b/include/mbgl/style/function/convert.hpp
@@ -339,7 +339,7 @@ struct Convert {
[&] (const type::ColorType&) {
std::vector<std::unique_ptr<Expression>> args;
args.push_back(makeGet("string", property, ParsingContext(errors)));
- ParseResult color = CompoundExpressionRegistry::create("parse_color", std::move(args), ParsingContext(errors));
+ ParseResult color = CompoundExpressionRegistry::create("to-color", std::move(args), ParsingContext(errors));
assert(color);
return std::move(*color);
},
diff --git a/src/mbgl/style/expression/compound_expression.cpp b/src/mbgl/style/expression/compound_expression.cpp
index 24b7a07583..1c2f39dcfd 100644
--- a/src/mbgl/style/expression/compound_expression.cpp
+++ b/src/mbgl/style/expression/compound_expression.cpp
@@ -313,7 +313,7 @@ std::unordered_map<std::string, Definition> CompoundExpressionRegistry::definiti
define("boolean", assertion<bool>),
define("object", assertion<std::unordered_map<std::string, Value>>),
- define("to_string", [](const Value& value) -> Result<std::string> {
+ define("to-string", [](const Value& value) -> Result<std::string> {
return value.match(
[](const std::unordered_map<std::string, Value>&) -> Result<std::string> {
return EvaluationError {
@@ -328,7 +328,7 @@ std::unordered_map<std::string, Definition> CompoundExpressionRegistry::definiti
[](const auto& v) -> Result<std::string> { return stringify(v); }
);
}),
- define("to_number", [](const Value& v) -> Result<double> {
+ define("to-number", [](const Value& v) -> Result<double> {
optional<double> result = v.match(
[](const double f) -> optional<double> { return f; },
[](const std::string& s) -> optional<double> {
@@ -347,7 +347,7 @@ std::unordered_map<std::string, Definition> CompoundExpressionRegistry::definiti
}
return *result;
}),
- define("to_boolean", [](const Value& v) -> Result<bool> {
+ define("to-boolean", [](const Value& v) -> Result<bool> {
return v.match(
[&] (double f) { return (bool)f; },
[&] (const std::string& s) { return s.length() > 0; },
@@ -356,11 +356,11 @@ std::unordered_map<std::string, Definition> CompoundExpressionRegistry::definiti
[&] (const auto&) { return true; }
);
}),
- define("to_rgba", [](const mbgl::Color& color) -> Result<std::array<double, 4>> {
+ define("to-rgba", [](const mbgl::Color& color) -> Result<std::array<double, 4>> {
return std::array<double, 4> {{ color.r, color.g, color.b, color.a }};
}),
- define("parse_color", [](const std::string& colorString) -> Result<mbgl::Color> {
+ define("parse-color", [](const std::string& colorString) -> Result<mbgl::Color> {
const optional<mbgl::Color> result = mbgl::Color::parse(colorString);
if (result) return *result;
return EvaluationError {
@@ -435,7 +435,7 @@ std::unordered_map<std::string, Definition> CompoundExpressionRegistry::definiti
return result;
}),
- define("geometry_type", [](const EvaluationParameters& params) -> Result<std::string> {
+ define("geometry-type", [](const EvaluationParameters& params) -> Result<std::string> {
if (!params.feature) {
return EvaluationError {
"Feature data is unavailable in the current evaluation context."
diff --git a/src/mbgl/style/function/expression.cpp b/src/mbgl/style/function/expression.cpp
index b26acd740d..ccbc59a5f0 100644
--- a/src/mbgl/style/function/expression.cpp
+++ b/src/mbgl/style/function/expression.cpp
@@ -38,7 +38,7 @@ bool Expression::isFeatureConstant() const {
} else {
featureConstant = featureConstant && !(
name == "properties" ||
- name == "geometry_type" ||
+ name == "geometry-type" ||
name == "id"
);
}