Closed christian-bromann closed 7 months ago
@jrandolf PTAL
To be more specific, script.RegExpLocalValue
(and similarly the other) is a map therefore it define types, not groups, so what you wrote is a keyless value in a map (which is valid syntax, but does not spread.
The easiest way to think the difference between groups and types is the behavior in an array.
Example 1:
b = text
a = [b]
Means array with a single string.
Example 2:
b = (text, text)
a = [b]
Means array with two strings.
Example 3:
b = [text, text]
a = [b]
Means array with a single array with two strings.
Note for arrays, the following are equivalent:
a = [(foo: text, bar: text)]
a = [(text, text)]
a = [text, text]
For maps, the following is syntactically allowed, but is considered illegal in CDDL:
a = {(text, text)}
which means a map with two entries (but the key is not defined, so it doesn't make sense which is why it's illegal.)
Closing this as it's incorrect.
In 2.1 of the cddl spec it is defined how groups can be merged together:
While the
.and
type describes the same:I don't think it can be used in the context when a group is assigned to a variable especially as we can just use the format described in 2.1.
Preview | Diff