From ed19ece346fd68c1b5cc1e8b8b2e398025a85d6d Mon Sep 17 00:00:00 2001 From: Alberto Restifo Date: Sun, 19 Apr 2020 13:45:00 +0200 Subject: [PATCH] Add diagnostic notation for bytes --- src/cbor/token.cr | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/cbor/token.cr b/src/cbor/token.cr index 6484e55..3a41caa 100644 --- a/src/cbor/token.cr +++ b/src/cbor/token.cr @@ -14,8 +14,11 @@ class CBOR::Token case token when IntT token.value.to_s + when BytesT + return %(h'') if token.value.empty? + "h'#{token.value.hexstring}'" else - "NOT IMPLEMENTED YET!" + raise "Diagnostic notation for type #{token.class} not implemented" end end end