From 4d54e818898b1444da3cb75235971897131d1b06 Mon Sep 17 00:00:00 2001 From: Artem Pavlenko Date: Tue, 4 Feb 2020 11:40:52 +0000 Subject: [PATCH] Use char const* as iterator type for CSS grammar --- src/css/css_color_grammar_x3.cpp | 6 ++++-- src/css/css_grammar_x3.cpp | 3 +-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/css/css_color_grammar_x3.cpp b/src/css/css_color_grammar_x3.cpp index cab594861..553f5074d 100644 --- a/src/css/css_color_grammar_x3.cpp +++ b/src/css/css_color_grammar_x3.cpp @@ -29,11 +29,13 @@ namespace mapnik { namespace css_color_grammar { namespace x3 = boost::spirit::x3; using iterator_type = std::string::const_iterator; +using iterator_css_type = char const*; using context_type = x3::phrase_parse_context::type; -using context_skipper_type = x3::phrase_parse_context::type; +using context_css_type = x3::phrase_parse_context::type; + BOOST_SPIRIT_INSTANTIATE(css_color_grammar_type, iterator_type, context_type); -BOOST_SPIRIT_INSTANTIATE(css_color_grammar_type, iterator_type, context_skipper_type); +BOOST_SPIRIT_INSTANTIATE(css_color_grammar_type, iterator_css_type, context_css_type); #if BOOST_VERSION < 107000 template bool parse_rule diff --git a/src/css/css_grammar_x3.cpp b/src/css/css_grammar_x3.cpp index f57ff29bb..47889a5bb 100644 --- a/src/css/css_grammar_x3.cpp +++ b/src/css/css_grammar_x3.cpp @@ -26,7 +26,7 @@ namespace mapnik { namespace css_grammar { namespace x3 = boost::spirit::x3; -using iterator_type = std::string::const_iterator; +using iterator_type = char const*; using context_type = x3::phrase_parse_context::type; BOOST_SPIRIT_INSTANTIATE(ident_grammar_type, iterator_type, context_type); @@ -35,7 +35,6 @@ BOOST_SPIRIT_INSTANTIATE(css_grammar_type, iterator_type, context_type); BOOST_SPIRIT_INSTANTIATE(css_skipper_type, iterator_type, x3::unused_type); } - css_grammar::ident_grammar_type const ident_grammar() { return css_grammar::ident;