]> Cypherpunks repositories - keks.git/commitdiff
Add invalid item type for zeroed memory
authorSergey Matveev <stargrave@stargrave.org>
Sun, 15 Dec 2024 08:32:21 +0000 (11:32 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Sun, 15 Dec 2024 09:24:18 +0000 (12:24 +0300)
cyac/lib/dec.h
gyac/types/type.go
gyac/types/type_string.go

index c582ac7c963005c7ace796b13f45f2f9d564e8070fc6e94561f8433d1c8e75f5..190459a0048747ddec7d2f0475b6517bc4598ba9d0605785da1ffc6787ece9f6 100644 (file)
@@ -10,6 +10,7 @@
 // @deftp {Data type} {enum YACItemType}
 // High-level type of the atom.
 // @itemize
+// @item YACItemInvalid -- invalid item value, uninitialised
 // @item YACItemEOC
 // @item YACItemNIL
 // @item YACItemFalse
@@ -28,8 +29,9 @@
 // @end itemize
 // @end deftp
 enum YACItemType {
-    YACItemEOC = 0,
-    YACItemNIL = 1,
+    YACItemInvalid = 0,
+    YACItemEOC = 1,
+    YACItemNIL,
     YACItemFalse,
     YACItemTrue,
     YACItemUUID,
index ba0d90ac3f19cacf4e56950a5d46b48742cb08af754bec9074538ba8ceaea944..fcfea0e0b19fb3ae40e41f811b05a5b3fd0d2d3f419590006d369448a01fd534 100644 (file)
@@ -4,7 +4,8 @@ type Type byte
 
 //go:generate stringer -type=Type
 const (
-       EOC Type = iota
+       Invalid Type = iota
+       EOC
        NIL
        Bool
        UUID
index c21de887932218024ece487c46c5cf14d0063e547c4c8937ba4c4ae551edc6aa..2cbecdfd44501292c44e26c02210f1fa56d47b8479202bfcae31ddc69a1864d8 100644 (file)
@@ -8,26 +8,27 @@ func _() {
        // An "invalid array index" compiler error signifies that the constant values have changed.
        // Re-run the stringer command to generate them again.
        var x [1]struct{}
-       _ = x[EOC-0]
-       _ = x[NIL-1]
-       _ = x[Bool-2]
-       _ = x[UUID-3]
-       _ = x[UInt-4]
-       _ = x[Int-5]
-       _ = x[BigInt-6]
-       _ = x[List-7]
-       _ = x[Map-8]
-       _ = x[Blob-9]
-       _ = x[Float-10]
-       _ = x[TAI64-11]
-       _ = x[Bin-12]
-       _ = x[Str-13]
-       _ = x[Raw-14]
+       _ = x[Invalid-0]
+       _ = x[EOC-1]
+       _ = x[NIL-2]
+       _ = x[Bool-3]
+       _ = x[UUID-4]
+       _ = x[UInt-5]
+       _ = x[Int-6]
+       _ = x[BigInt-7]
+       _ = x[List-8]
+       _ = x[Map-9]
+       _ = x[Blob-10]
+       _ = x[Float-11]
+       _ = x[TAI64-12]
+       _ = x[Bin-13]
+       _ = x[Str-14]
+       _ = x[Raw-15]
 }
 
-const _Type_name = "EOCNILBoolUUIDUIntIntBigIntListMapBlobFloatTAI64BinStrRaw"
+const _Type_name = "InvalidEOCNILBoolUUIDUIntIntBigIntListMapBlobFloatTAI64BinStrRaw"
 
-var _Type_index = [...]uint8{0, 3, 6, 10, 14, 18, 21, 27, 31, 34, 38, 43, 48, 51, 54, 57}
+var _Type_index = [...]uint8{0, 7, 10, 13, 17, 21, 25, 28, 34, 38, 41, 45, 50, 55, 58, 61, 64}
 
 func (i Type) String() string {
        if i >= Type(len(_Type_index)-1) {