From 1d734913494535ac22b030bb5e8fe835ac60d5b65d5b09596beee52e69a9c546 Mon Sep 17 00:00:00 2001 From: Sergey Matveev Date: Wed, 9 Apr 2025 11:14:20 +0300 Subject: [PATCH] Simpler RAW --- tcl/keks.tcl | 6 +----- tcl/mk-fuzz-inputs | 2 +- tcl/test-vector.tcl | 4 ++-- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/tcl/keks.tcl b/tcl/keks.tcl index a1cae56..a1afda1 100644 --- a/tcl/keks.tcl +++ b/tcl/keks.tcl @@ -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 diff --git a/tcl/mk-fuzz-inputs b/tcl/mk-fuzz-inputs index c3ad2bf..bfab998 100755 --- a/tcl/mk-fuzz-inputs +++ b/tcl/mk-fuzz-inputs @@ -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 diff --git a/tcl/test-vector.tcl b/tcl/test-vector.tcl index 482dc4a..27609bc 100644 --- a/tcl/test-vector.tcl +++ b/tcl/test-vector.tcl @@ -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} -- 2.48.1