[Lobster] support unsigned integer reads

(depends on the latest Lobster version)
This commit is contained in:
Wouter van Oortmerssen
2022-03-08 15:13:13 -08:00
parent 4016c549d3
commit 777e78d8dd
4 changed files with 49 additions and 46 deletions

View File

@@ -60,7 +60,10 @@ class LobsterGenerator : public BaseGenerator {
std::string GenTypeName(const Type &type) {
auto bits = NumToString(SizeOf(type.base_type) * 8);
if (IsInteger(type.base_type)) return "int" + bits;
if (IsInteger(type.base_type)) {
if (IsUnsigned(type.base_type)) return "uint" + bits;
else return "int" + bits;
}
if (IsFloat(type.base_type)) return "float" + bits;
if (IsString(type)) return "string";
if (type.base_type == BASE_TYPE_STRUCT) return "table";