diff options
Diffstat (limited to 'include/mbgl/style/expression/parsing_context.hpp')
-rw-r--r-- | include/mbgl/style/expression/parsing_context.hpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/include/mbgl/style/expression/parsing_context.hpp b/include/mbgl/style/expression/parsing_context.hpp index d1e209989f..31445271a9 100644 --- a/include/mbgl/style/expression/parsing_context.hpp +++ b/include/mbgl/style/expression/parsing_context.hpp @@ -7,10 +7,11 @@ #include <iterator> #include <map> -#include <unordered_map> +#include <memory> #include <string> +#include <unordered_map> +#include <utility> #include <vector> -#include <memory> namespace mbgl { namespace style { @@ -122,22 +123,21 @@ public: Check whether `t` is a subtype of `expected`, collecting an error if not. */ optional<std::string> checkType(const type::Type& t); - - optional<std::shared_ptr<Expression>> getBinding(const std::string name) { + + optional<std::shared_ptr<Expression>> getBinding(const std::string& name) { if (!scope) return optional<std::shared_ptr<Expression>>(); return scope->get(name); } - void error(std::string message) { - errors->push_back({message, key}); - } - + void error(std::string message) { errors->push_back({std::move(message), key}); } + void error(std::string message, std::size_t child) { - errors->push_back({message, key + "[" + util::toString(child) + "]"}); + errors->push_back({std::move(message), key + "[" + util::toString(child) + "]"}); } void error(std::string message, std::size_t child, std::size_t grandchild) { - errors->push_back({message, key + "[" + util::toString(child) + "][" + util::toString(grandchild) + "]"}); + errors->push_back( + {std::move(message), key + "[" + util::toString(child) + "][" + util::toString(grandchild) + "]"}); } void appendErrors(ParsingContext&& ctx) { |