From 33cfd080c2ce0f2ed0c9ee3102cedc4baedf0d8c Mon Sep 17 00:00:00 2001 From: Ander Conselvan de Oliveira Date: Tue, 2 Apr 2019 11:59:13 +0300 Subject: [core] Fix most identity function with default legacy expression tests Add handling of default value to the conversion of legacy identity functions. The color and enum tests still don't pass though. --- include/mbgl/style/expression/dsl.hpp | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) (limited to 'include/mbgl') diff --git a/include/mbgl/style/expression/dsl.hpp b/include/mbgl/style/expression/dsl.hpp index bd94a765e7..dc0f1ab90f 100644 --- a/include/mbgl/style/expression/dsl.hpp +++ b/include/mbgl/style/expression/dsl.hpp @@ -31,14 +31,21 @@ std::unique_ptr literal(Value value); std::unique_ptr literal(std::initializer_list value); std::unique_ptr literal(std::initializer_list value); -std::unique_ptr assertion(type::Type, std::unique_ptr); -std::unique_ptr number(std::unique_ptr); -std::unique_ptr string(std::unique_ptr); -std::unique_ptr boolean(std::unique_ptr); - -std::unique_ptr toColor(std::unique_ptr); -std::unique_ptr toString(std::unique_ptr); -std::unique_ptr toFormatted(std::unique_ptr); +std::unique_ptr assertion(type::Type, std::unique_ptr, + optional> def = {}); +std::unique_ptr number(std::unique_ptr, + optional> def = {}); +std::unique_ptr string(std::unique_ptr, + optional> def = {}); +std::unique_ptr boolean(std::unique_ptr, + optional> def = {}); + +std::unique_ptr toColor(std::unique_ptr, + optional> def = {}); +std::unique_ptr toString(std::unique_ptr, + optional> def = {}); +std::unique_ptr toFormatted(std::unique_ptr, + optional> def = {}); std::unique_ptr get(const char* value); std::unique_ptr get(std::unique_ptr); -- cgit v1.2.1