json - simplify generic_json rules: remove redundant rule
This commit is contained in:
parent
21487f36b9
commit
c2bf2be7ba
5 changed files with 7 additions and 20 deletions
|
@ -148,13 +148,10 @@ extract_bounding_box_grammar<Iterator, Boxes, ErrorHandler>::extract_bounding_bo
|
|||
json.value = json.object | json.array | json.string_ | json.number
|
||||
;
|
||||
|
||||
json.pairs = json.key_value % lit(',')
|
||||
json.key_value = json.string_ >> lit(':') >> json.value
|
||||
;
|
||||
|
||||
json.key_value = (json.string_ >> lit(':') >> json.value)
|
||||
;
|
||||
|
||||
json.object = lit('{') >> json.pairs >> lit('}')
|
||||
json.object = lit('{') >> json.key_value % lit(',') >> lit('}')
|
||||
;
|
||||
|
||||
json.array = lit('[')
|
||||
|
|
|
@ -53,14 +53,11 @@ feature_grammar<Iterator,FeatureType,ErrorHandler>::feature_grammar(mapnik::tran
|
|||
json_.value = json_.object | json_.array | json_.string_ | json_.number
|
||||
;
|
||||
|
||||
json_.pairs = json_.key_value % lit(',')
|
||||
;
|
||||
|
||||
json_.key_value = json_.string_ > lit(':') > json_.value
|
||||
;
|
||||
|
||||
json_.object = lit('{')
|
||||
> json_.pairs
|
||||
> json_.key_value % lit(',')
|
||||
> lit('}')
|
||||
;
|
||||
|
||||
|
|
|
@ -167,7 +167,6 @@ struct generic_json
|
|||
qi::rule<Iterator, json_value(), space_type> number;
|
||||
qi::rule<Iterator, std::unordered_map<std::string, json_value>(), space_type> object;
|
||||
qi::rule<Iterator, std::vector<json_value>(), space_type> array;
|
||||
qi::rule<Iterator, std::unordered_map<std::string, json_value>(), space_type> pairs;
|
||||
qi::real_parser<double, qi::strict_real_policies<double>> strict_double;
|
||||
// conversions
|
||||
boost::phoenix::function<mapnik::detail::value_converter<mapnik::value_integer>> integer_converter;
|
||||
|
|
|
@ -58,14 +58,11 @@ geometry_grammar<Iterator, ErrorHandler>::geometry_grammar()
|
|||
json_.value = json_.object | json_.array | json_.string_ | json_.number
|
||||
;
|
||||
|
||||
json_.pairs = json_.key_value % lit(',')
|
||||
;
|
||||
|
||||
json_.key_value = (json_.string_ > lit(':') > json_.value)
|
||||
json_.key_value = json_.string_ > lit(':') > json_.value
|
||||
;
|
||||
|
||||
json_.object = lit('{')
|
||||
> json_.pairs
|
||||
> json_.key_value % lit(',')
|
||||
> lit('}')
|
||||
;
|
||||
json_.array = lit('[')
|
||||
|
|
|
@ -133,13 +133,10 @@ topojson_grammar<Iterator, ErrorHandler>::topojson_grammar()
|
|||
json.value = json.object | json.array | json.string_ | json.number
|
||||
;
|
||||
|
||||
json.pairs = json.key_value % lit(',')
|
||||
json.key_value = json.string_ >> lit(':') >> json.value
|
||||
;
|
||||
|
||||
json.key_value = (json.string_ >> lit(':') >> json.value)
|
||||
;
|
||||
|
||||
json.object = lit('{') >> json.pairs >> lit('}')
|
||||
json.object = lit('{') >> json.key_value % lit(',') >> lit('}')
|
||||
;
|
||||
|
||||
json.array = lit('[')
|
||||
|
|
Loading…
Reference in a new issue