w3c / webdriver-bidi

Bidirectional WebDriver protocol for browser automation
https://w3c.github.io/webdriver-bidi/
363 stars 40 forks source link

(cddl): remove brackets from range #599

Closed christian-bromann closed 10 months ago

christian-bromann commented 10 months ago

I can't really read of the CDDL spec whether or not extra brackets around type primitives, e.g. ranges, can be ignored or not but if we assume not, an opening bracket (especially as part of a key assignment) creates a group that has to consist of a key value pair and can't be a single type.


Preview | Diff

OrKoN commented 10 months ago

I recall there was some ambiguity without the brackets. @jrandolf PTAL

christian-bromann commented 10 months ago

This is why I mentioned that the spec is not very clear about this. One could argue that the 0.1..2.0 part within 0.1..2.0 .default 1.0 can be seen as a single type (a range) and resolves into [range] .default [float]. That said, I've seen the following example while skimming through the CDDL spec:

label = bstr .size (1..63)

which proves your assumption to be correct. Therefor I will go ahead and close this.

Just fyi: I am working on a cddl parser where these nit picky details make a big difference. Thanks for your feedback!

jrandolf-2 commented 10 months ago

@christian-bromann You may want to check out https://github.com/anweiss/cddl. It's already fully compliant and we use it as our backend for code generation (https://github.com/google/cddlconv).