You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@alistair23 can you post the CDDL file (or snippet from it) that encountered it? It's possible it could be rewritten to work around it in the meantime (and good to reference for the issue in general).
What are you trying to achieve with &(class-id: 0)? We had never used & in the specs we've been generating from but what is the point in doing it on a basic group of only 1 value? Doesn't that create a type choice of only 1 option, that being 0? Or does this do something with the group encoding when you're putting it in the outer group? Forgive me if I'm not understanding things.
If those are just meant to be the uint values for each of those keys then try directly placing them as:
The generic support is also rather weak so you might need to avoid using it (what is the definition for non-empty<T>?) I stuck in those ; @name comments since it lets our parser name fields custom things instead of trying to name it after the key's value (key_0, key_1, key_2, etc here without those)
Activity
rooooooooob commentedon Mar 23, 2023
@alistair23 can you post the CDDL file (or snippet from it) that encountered it? It's possible it could be rewritten to work around it in the meantime (and good to reference for the issue in general).
alistair23 commentedon Mar 23, 2023
Yep!
So running
On
Gives me this
If you have any ideas of how to re-write it please let me know :)
rooooooooob commentedon Mar 23, 2023
What are you trying to achieve with
&(class-id: 0)? We had never used&in the specs we've been generating from but what is the point in doing it on a basic group of only 1 value? Doesn't that create a type choice of only 1 option, that being0? Or does this do something with the group encoding when you're putting it in the outer group? Forgive me if I'm not understanding things.If those are just meant to be the uint values for each of those keys then try directly placing them as:
The generic support is also rather weak so you might need to avoid using it (what is the definition for
non-empty<T>?) I stuck in those; @namecomments since it lets our parser name fields custom things instead of trying to name it after the key's value (key_0,key_1,key_2, etc here without those)alistair23 commentedon Mar 23, 2023
I have no idea, the
class-mapis taken from here:https://github.com/ietf-rats-wg/draft-ietf-rats-corim/blob/b4c4b88550c2c2fbad47e9866bc6e0f1c6a303b3/cddl/class-map.cddl#L1
I'm not sure why they put it in a choice. I haven't yet wrapped my head around CDDL to have any idea why someone would do that.
As for the non-empty, it's also defined here: https://github.com/ietf-rats-wg/draft-ietf-rats-corim/blob/b4c4b88550c2c2fbad47e9866bc6e0f1c6a303b3/draft-ietf-rats-corim.md?plain=1#L151
rooooooooob commentedon Mar 23, 2023
I don't think we can work around that non-empty restriction via cddl-codegen/changing the CDDL then. You can still try doing just:
and either not care that it doesn't enforce the non-empty requirement, or write that check yourself (should be like 1-2 lines of code).