From 6d48a182f72bdfd45f31d55d11e0bf9bfd467d8c Mon Sep 17 00:00:00 2001 From: Faye Amacker <33205765+fxamacker@users.noreply.github.com> Date: Mon, 21 Nov 2022 13:45:37 -0600 Subject: [PATCH] Add parentheses to CDDL for readability Add parentheses to CDDL to make order of precedence more obvious. This change is a NOP and does not affect codecs. --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index bb09038..ee9d3aa 100644 --- a/README.md +++ b/README.md @@ -302,6 +302,7 @@ This document uses CDDL notation to express CBOR data items: - `tstr`: CBOR text string - `bigint`: CBOR bignum - `? Foo`: Foo is optional +- `(Foo)`: Foo is a group - `Foo / Bar`: either Foo or Bar - `Foo + Bar`: Foo followed by Bar - `[+ Foo]`: one or more Foo in CBOR array @@ -322,9 +323,9 @@ Cadence data is encoded depending on its type. For example, Cadence `UInt8` is ``` -CCF_Message = ? CCF_CompositeTypeInfo_Message + CCF_TypeAndValue_Message +CCF_Message = (? CCF_CompositeTypeInfo_Message) + CCF_TypeAndValue_Message -CCF_CompositeTypeInfo_Message = #6.CBORTagType([+ CCF_StructTypeInfo_Message / CCF_ResourceTypeInfo_Message / CCF_ContractTypeInfo_Message / CCF_EventTypeInfo_Message / CCF_EnumTypeInfo_Message]) +CCF_CompositeTypeInfo_Message = #6.CBORTagType([+ (CCF_StructTypeInfo_Message / CCF_ResourceTypeInfo_Message / CCF_ContractTypeInfo_Message / CCF_EventTypeInfo_Message / CCF_EnumTypeInfo_Message)]) composite_type_record = [ id: bstr,