Added ubyte and byte type to builtins.d

entity_declaration_type_checking
Tristan B. V. Kildaire 2021-04-26 09:53:47 +02:00
parent 8c3c14d412
commit bbef8c00f9
1 changed files with 11 additions and 0 deletions

View File

@ -40,6 +40,17 @@ public Type getBuiltInType(string typeString)
{
return new Integer("ushort", 2, false);
}
/* `byte`, signed (2-complement) */
else if(cmp(typeString, "byte") == 0)
{
return new Integer("byte", 1, true);
}
/* `ubyte` unsigned */
else if(cmp(typeString, "ubyte") == 0)
{
return new Integer("ubyte", 1, false);
}
/* TODO: Add all remaining types */
/* If unknown, return null */