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)