From e46785a063003d62d7fd267a29f13f8c53fff133 Mon Sep 17 00:00:00 2001 From: artemp Date: Wed, 14 Dec 2016 10:49:11 +0100 Subject: [PATCH] wrap grammar into anonymous namespace - attempting to fix VC++ compilation issue (#3573) --- src/svg/svg_parser.cpp | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/svg/svg_parser.cpp b/src/svg/svg_parser.cpp index 9247eef86..0d4db78d4 100644 --- a/src/svg/svg_parser.cpp +++ b/src/svg/svg_parser.cpp @@ -94,29 +94,26 @@ void parse_attr(svg_parser & parser,rapidxml::xml_node const* node); void parse_attr(svg_parser & parser,char const * name, char const* value); -namespace grammar { +namespace { namespace grammar { namespace x3 = boost::spirit::x3; using color_lookup_type = std::vector >; using pairs_type = std::vector >; -x3::rule const key_value_sequence_ordered("key_value_sequence_ordered"); -x3::rule > key_value("key_value"); -x3::rule key("key"); -x3::rule value("value"); +x3::rule const key_value_sequence_ordered("key_value_sequence_ordered"); +x3::rule > key_value("key_value"); +x3::rule key("key"); +x3::rule value("value"); auto const key_def = x3::char_("a-zA-Z_") > *x3::char_("a-zA-Z_0-9-"); auto const value_def = +(x3::char_ - ';'); auto const key_value_def = key > -(':' > value); auto const key_value_sequence_ordered_def = key_value % ';'; -BOOST_SPIRIT_DEFINE(key); -BOOST_SPIRIT_DEFINE(value); -BOOST_SPIRIT_DEFINE(key_value); -BOOST_SPIRIT_DEFINE(key_value_sequence_ordered); +BOOST_SPIRIT_DEFINE(key, value, key_value, key_value_sequence_ordered); -} +}} template mapnik::color parse_color(T & error_messages, const char* str)