mirror of
https://github.com/mapnik/mapnik.git
synced 2025-12-08 20:13:09 +00:00
handle empty arrays and objects ref #3426
This commit is contained in:
parent
4429155759
commit
4e6aeaedfc
@ -50,19 +50,19 @@ feature_grammar<Iterator,FeatureType,ErrorHandler>::feature_grammar(mapnik::tran
|
||||
using phoenix::construct;
|
||||
|
||||
// generic json types
|
||||
json_.value = json_.object | json_.array | json_.string_ | json_.number
|
||||
json_.value = json_.object | json_.array | json_.string_ | json_.number
|
||||
;
|
||||
|
||||
json_.key_value = json_.string_ > lit(':') > json_.value
|
||||
;
|
||||
|
||||
json_.object = lit('{')
|
||||
> json_.key_value % lit(',')
|
||||
> -(json_.key_value % lit(','))
|
||||
> lit('}')
|
||||
;
|
||||
|
||||
json_.array = lit('[')
|
||||
> json_.value > *(lit(',') > json_.value)
|
||||
> -(json_.value % lit(','))
|
||||
> lit(']')
|
||||
;
|
||||
|
||||
|
||||
@ -62,13 +62,15 @@ geometry_grammar<Iterator, ErrorHandler>::geometry_grammar()
|
||||
;
|
||||
|
||||
json_.object = lit('{')
|
||||
> json_.key_value % lit(',')
|
||||
> -(json_.key_value % lit(','))
|
||||
> lit('}')
|
||||
;
|
||||
|
||||
json_.array = lit('[')
|
||||
> json_.value > *(lit(',') > json_.value)
|
||||
> -(json_.value % lit(','))
|
||||
> lit(']')
|
||||
;
|
||||
|
||||
json_.number = json_.strict_double
|
||||
| json_.int__
|
||||
| lit("true")
|
||||
|
||||
@ -133,15 +133,17 @@ topojson_grammar<Iterator, ErrorHandler>::topojson_grammar()
|
||||
json.value = json.object | json.array | json.string_ | json.number
|
||||
;
|
||||
|
||||
json.key_value = json.string_ >> lit(':') >> json.value
|
||||
json.key_value = json.string_ > lit(':') > json.value
|
||||
;
|
||||
|
||||
json.object = lit('{') >> json.key_value % lit(',') >> lit('}')
|
||||
json.object = lit('{')
|
||||
> -(json.key_value % lit(','))
|
||||
> lit('}')
|
||||
;
|
||||
|
||||
json.array = lit('[')
|
||||
>> json.value >> *(lit(',') >> json.value)
|
||||
>> lit(']')
|
||||
> -(json.value % lit(','))
|
||||
> lit(']')
|
||||
;
|
||||
|
||||
json.number = json.strict_double[_val = json.double_converter(_1)]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user