Nullus157 / cbor-diag-rs

Support for parsing/encoding CBOR diagnostic notation and annotated hex
https://cbor.nemo157.com
Apache License 2.0
10 stars 6 forks source link

Allow trailing comma without trailing whitespace #144

Open chrysn opened 4 months ago

chrysn commented 4 months ago

There were cases when a trailing comma (that is mostly allowed by this implementation, also by the upcoming spec, for but not tested) was not allowed:

$ echo '[1,2,3,]' | cargo run -- --from diag --to diag
Error: Failed all parsers

This patch fixes this by allowing the white space after the comma to be absent. I'm not sure that covers all the cases that were missing, but at least it covers a file I was using.