From 2d2c5a191be83f182a1c4d22e5ae42fe81a45107 Mon Sep 17 00:00:00 2001 From: artemp Date: Wed, 1 Mar 2017 11:58:18 +0100 Subject: [PATCH] expression_grammar: re-use unicode_string_grammar and add initial support for `\uNNNNN` code points (TODO) --- include/mapnik/expression_grammar_x3_def.hpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/include/mapnik/expression_grammar_x3_def.hpp b/include/mapnik/expression_grammar_x3_def.hpp index 23735e5de..2b5f24236 100644 --- a/include/mapnik/expression_grammar_x3_def.hpp +++ b/include/mapnik/expression_grammar_x3_def.hpp @@ -24,6 +24,7 @@ #define MAPNIK_EXPRESSIONS_GRAMMAR_X3_DEF_HPP #include +#include #include #include #include @@ -65,6 +66,9 @@ namespace mapnik { namespace grammar { using x3::alnum; x3::uint_parser const hex2 {}; + namespace { + auto const& double_quoted = json::unicode_string_grammar(); + } auto do_assign = [] (auto const& ctx) { _val(ctx) = std::move(_attr(ctx)); @@ -303,8 +307,8 @@ namespace mapnik { namespace grammar { // strings auto const single_quoted_string = x3::rule {} = lit('\'') >> no_skip[*(unesc_char | ("\\x" > hex2) | (char_ - '\''))] > '\''; - auto const double_quoted_string = x3::rule {} = lit('"') >> no_skip[*(unesc_char | ("\\x" > hex2) | (char_ - '"'))] > '"'; - auto const quoted_string = x3::rule {} = single_quoted_string | double_quoted_string; + //auto const double_quoted_string = x3::rule {} = lit('"') >> no_skip[*(unesc_char | ("\\x" > hex2) | (char_ - '"'))] > '"'; + auto const quoted_string = x3::rule {} = single_quoted_string | double_quoted;//_string; auto const unquoted_ustring = x3::rule {} = no_skip[alpha > *alnum] - lit("not");