feature_grammar - simplify further, remove redundant rule
This commit is contained in:
parent
3909fe5b7d
commit
5e33dc0551
2 changed files with 1 additions and 7 deletions
|
@ -76,7 +76,6 @@ struct feature_grammar : qi::grammar<Iterator, void(FeatureType&), space_type>
|
|||
qi::rule<Iterator, space_type> feature_type;
|
||||
qi::rule<Iterator,void(FeatureType &),space_type> properties;
|
||||
qi::rule<Iterator,qi::locals<std::string>, void(FeatureType &),space_type> attributes;
|
||||
qi::rule<Iterator, json_value(), space_type> attribute_value;
|
||||
// functions
|
||||
phoenix::function<put_property> put_property_;
|
||||
phoenix::function<set_geometry_impl> set_geometry;
|
||||
|
|
|
@ -94,18 +94,13 @@ feature_grammar<Iterator,FeatureType,ErrorHandler>::feature_grammar(mapnik::tran
|
|||
> lit(':') > ((lit('{') > -attributes(_r1) > lit('}')) | lit("null"))
|
||||
;
|
||||
|
||||
attributes = (json_.string_ [_a = _1] > lit(':') > attribute_value [put_property_(_r1,_a,_1)]) % lit(',')
|
||||
;
|
||||
|
||||
attribute_value %= json_.number | json_.string_ | json_.object | json_.array
|
||||
attributes = (json_.string_ [_a = _1] > lit(':') > json_.value [put_property_(_r1,_a,_1)]) % lit(',')
|
||||
;
|
||||
|
||||
feature.name("Feature");
|
||||
feature_type.name("type");
|
||||
properties.name("properties");
|
||||
attributes.name("Attributes");
|
||||
attribute_value.name("Attribute Value");
|
||||
|
||||
on_error<fail>(feature, error_handler(_1, _2, _3, _4));
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue