]> Cypherpunks repositories - keks.git/commitdiff
Simpler RAW
authorSergey Matveev <stargrave@stargrave.org>
Wed, 9 Apr 2025 08:14:20 +0000 (11:14 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Wed, 9 Apr 2025 08:44:37 +0000 (11:44 +0300)
tcl/keks.tcl
tcl/mk-fuzz-inputs
tcl/test-vector.tcl

index a1cae56bf5a7e7fcfbe049727f808a103653e3b090b081d55d6a3812af5018fb..a1afda13ad88a725566f38b2bc47aac489a52c256f7bd4fbbbfe44cc3641c6c7 100644 (file)
@@ -24,6 +24,7 @@ proc add {v} {
 
 proc char {v} {add [binary format c $v]}
 
+proc RAW {v} {add $v}
 proc EOC {} {char [expr 0x00]}
 proc NIL {} {char [expr 0x01]}
 proc FALSE {} {char [expr 0x02]}
@@ -253,11 +254,6 @@ proc TAI64 {v {n 0} {a 0}} {
     }
 }
 
-proc RAW {t v} {
-    char $t
-    add $v
-}
-
 namespace export EOC NIL FALSE TRUE HEXLET MAGIC INT STR BIN RAW
 namespace export TAI64 UTCFromISO
 namespace export LIST MAP SET LenFirstSort BLOB
index c3ad2bfdaf86516c770488616ed70a6da3042bda5b25cf83d96ec663b117a625..bfab998aead0bd91b82dc565edc42723682f5a224d0cfed2adea867e30fd2c8c 100755 (executable)
@@ -28,7 +28,7 @@ dump 'MAP {}' >map-empty
 dump 'MAP {a {LIST {NIL}}}' >map-foo
 dump 'TAI64 [UTCFromISO "1970-01-01 00:00:00"]' >tai-utc0
 dump 'TAI64 -11' >tai-before
-dump 'RAW [expr 0x18] [binary decode hex "40000000586846A4"]' >tai-leap
+dump 'RAW [binary decode hex "1840000000586846A4"]' >tai-leap
 dump 'TAI64 1234 1234' >tai-ns
 dump 'TAI64 1234 1234 1234' >tai-as
 dump "MAGIC fuzz" >magic
index 482dc4a5b24b42eab2d52b48ff179f354846a02e244eb69ad0ad708eb26f432e..27609bcfc0209272027cf8aae38f4228bf2db41a0d0ba478a4169dffcc54cc38 100644 (file)
@@ -29,7 +29,7 @@ MAP {
         }}
     }}
     floats {LIST {
-        {RAW [expr 0x11] [binary decode hex "01020304"]}
+        {RAW [binary decode hex "1101020304"]}
     }}
     nil NIL
     bool {LIST {TRUE FALSE}}
@@ -57,7 +57,7 @@ MAP {
         {MAP {}}
         {BLOB 123 ""}
         {HEXLET "00000000-0000-0000-0000-000000000000"}
-        {RAW [expr 0x18] [binary decode hex "0000000000000000"]}
+        {RAW [binary decode hex "180000000000000000"]}
     }}
     dates {LIST {
         {TAI64 1234567890}