Added short type aliases to peon stdlib + minor comment fixes

This commit is contained in:
Mattia Giambirtone 2023-01-24 12:22:26 +01:00
parent bf2be7deac
commit c666c66813
2 changed files with 15 additions and 6 deletions

View File

@ -789,8 +789,7 @@ proc isAny*(typ: Type): bool =
if condition.kind.isAny(): if condition.kind.isAny():
return true return true
else: else:
discard return false
return false
method match*(self: Compiler, name: string, kind: Type, node: ASTNode = nil, allowFwd: bool = true): Name = method match*(self: Compiler, name: string, kind: Type, node: ASTNode = nil, allowFwd: bool = true): Name =

View File

@ -12,19 +12,19 @@ type int16* = object {
#pragma[magic: "int16"] #pragma[magic: "int16"]
} }
type int8* = object { type int8* = object {
#pragma[magic: "int8"] #pragma[magic: "int8"]
} }
type uint64* = object { type uint64* = object {
#pragma[magic: "uint64"] #pragma[magic: "uint64"]
} }
type uint32* = object { type uint32* = object {
#pragma[magic: "uint32"] #pragma[magic: "uint32"]
} }
type uint16* = object { type uint16* = object {
#pragma[magic: "uint16"] #pragma[magic: "uint16"]
} }
@ -71,6 +71,16 @@ type auto* = object {
# Some convenience aliases # Some convenience aliases
type int* = int64; type int* = int64;
type float* = float64; type float* = float64;
type i64* = int64;
type u64* = uint64;
type i32* = int32;
type u32* = uint32;
type i16* = int64;
type u16* = uint64;
type i8* = int32;
type u8* = uint32;
type f64* = float64;
type f32* = float32;
type SignedInteger* = int64 | int32 | int16 | int8; type SignedInteger* = int64 | int32 | int16 | int8;
type UnsignedInteger* = uint64 | uint32 | uint16 | uint8; type UnsignedInteger* = uint64 | uint32 | uint16 | uint8;
type Integer* = SignedInteger | UnsignedInteger; type Integer* = SignedInteger | UnsignedInteger;