Update to crystal version 1.5.0

This commit is contained in:
Dominic Grimm 2022-07-08 19:43:14 +02:00
parent e10f11fc1a
commit 9fa85297b9
No known key found for this signature in database
GPG key ID: A6C051C716D2CE65
2 changed files with 8 additions and 8 deletions

View file

@ -8,7 +8,7 @@ targets:
hence: hence:
main: src/cli/hence.cr main: src/cli/hence.cr
crystal: 1.4.1 crystal: 1.5.0
license: MIT license: MIT

View file

@ -180,12 +180,12 @@ module Hence
def initialize(@number : UInt16) def initialize(@number : UInt16)
end end
def resolve(_data : Assembler::Data) : Bytes def resolve(data : Assembler::Data) : Bytes
n = Utils.split_u16(@number) n = Utils.split_u16(@number)
Bytes[n[0], n[1]] Bytes[n[0], n[1]]
end end
def resolve_as_number(_data : Assembler::Data) : UInt16 def resolve_as_number(data : Assembler::Data) : UInt16
@number @number
end end
@ -219,11 +219,11 @@ module Hence
def initialize(@bytes : Bytes) def initialize(@bytes : Bytes)
end end
def resolve(_data : Assembler::Data) : Bytes def resolve(data : Assembler::Data) : Bytes
@bytes @bytes
end end
def resolve_as_number(_data : Assembler::Data) : UInt16 def resolve_as_number(data : Assembler::Data) : UInt16
if @bytes.size == 1 if @bytes.size == 1
@bytes[0].to_u16 @bytes[0].to_u16
else else
@ -242,7 +242,7 @@ module Hence
def initialize(@string : String) def initialize(@string : String)
end end
def resolve(_data : Assembler::Data) : Bytes def resolve(data : Assembler::Data) : Bytes
if @string.bytesize == 1 if @string.bytesize == 1
Bytes[0_u8, @string.bytes[0]] Bytes[0_u8, @string.bytes[0]]
else else
@ -250,8 +250,8 @@ module Hence
end end
end end
def resolve_as_number(_data : Assembler::Data) : UInt16 def resolve_as_number(data : Assembler::Data) : UInt16
slice = resolve(_data) slice = resolve(data)
Utils.merge_u8(slice[0], slice[1]) Utils.merge_u8(slice[0], slice[1])
end end