cabo / cbor-diag

CBOR diagnostic utilities
55 stars 10 forks source link

Concatenated tstr/bstr fragments #16

Open BrianSipos opened 3 years ago

BrianSipos commented 3 years ago

The definition in Section G.4 of RFC8610 allows whitespace-separated tstr and bstr fragments to be treated as one whole concatenated value. When I attempt to use this with the tool diag2pretty I get an error shown below. This also happens if the whitespace includes newlines, which is what I was originally trying to do.

*** can't parse "test" "this"
*** Expected one of [ \t\n\r], "/" at line 1, column 8 (byte 8) after 
cabo commented 3 years ago

That is a feature of EDN that apparently did not make it into the implementation yet. This is not too hard to do, so I expect getting to it within a month or so.

rohanmahy commented 3 months ago

+1

FYI: This is also preventing me from using diag2cbor.rb and diag2pretty.rb directly with examples in Internet-Drafts (because I am trying to make my examples narrow enough to fit in 72 characters).

cabo commented 3 months ago

This is also preventing me from using diag2cbor.rb and diag2pretty.rb directly with examples in Internet-Drafts (because I am trying to make my examples narrow enough to fit in 72 characters).

Hi Rohan,

thank you, that is very useful input. I have prototyped the new ABNF in the edn-abnf tool (gem install edn-abnf). I waited with updating the cbor-diag tool (and thus also cbor.me) as I didn't want to destabilize that tool set.
Given that we seem to be converging, I could now integrate the edn-abnf parser updates into the cbor-diag code base.

rohanmahy commented 3 months ago

I will try using the edn-abnf tool.

cabo commented 3 months ago

If there is anything missing in edn-abnf that you need for that, please holler.