From dd1288089fb32f2cb76e6d20e7b310c4bc9c9b07 Mon Sep 17 00:00:00 2001 From: Alberto Restifo Date: Sun, 19 Apr 2020 20:49:48 +0200 Subject: [PATCH] Adjustements --- src/cbor/decoder.cr | 2 ++ src/cbor/lexer.cr | 2 +- src/cbor/token.cr | 3 +-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/cbor/decoder.cr b/src/cbor/decoder.cr index b9c7641..50ff8b4 100644 --- a/src/cbor/decoder.cr +++ b/src/cbor/decoder.cr @@ -18,6 +18,8 @@ abstract class CBOR::Decoder when Token::StringT finish_token! token.value + when Token::ByteArrayT + # Consume the array :) end end end diff --git a/src/cbor/lexer.cr b/src/cbor/lexer.cr index ff1b89b..e053ac4 100644 --- a/src/cbor/lexer.cr +++ b/src/cbor/lexer.cr @@ -17,7 +17,7 @@ class CBOR::Lexer def initialize(@io : IO) @current_pos = 0 - @token = Token::UndefinedT.new(0) + @token = Token::NullT.new(0) @token_finished = true end diff --git a/src/cbor/token.cr b/src/cbor/token.cr index 51d04a3..1247769 100644 --- a/src/cbor/token.cr +++ b/src/cbor/token.cr @@ -1,6 +1,5 @@ class CBOR::Token record NullT, byte_number : Int64 - record UndefinedT, byte_number : Int64 record BoolT, byte_number : Int64, value : Bool record ArrayT, byte_number : Int64, size : UInt32? record MapT, byte_number : Int64, size : UInt32? @@ -11,7 +10,7 @@ class CBOR::Token record StringArrayT, byte_number : Int64 record BytesArrayT, byte_number : Int64 - alias T = NullT | UndefinedT | BoolT | ArrayT | MapT | IntT | FloatT | StringT | BytesT | StringArrayT | BytesArrayT + alias T = NullT | BoolT | ArrayT | MapT | IntT | FloatT | StringT | BytesT | StringArrayT | BytesArrayT def self.to_s(token : T) case token