This commit is contained in:
nub31
2026-03-16 18:10:03 +01:00
parent bdeb2c4d73
commit bc65c3f4fd
7 changed files with 55 additions and 23 deletions

View File

@@ -102,6 +102,17 @@ public class NubTypeString : NubType
public override string ToString() => "string";
}
public class NubTypeChar : NubType
{
public static readonly NubTypeChar Instance = new();
private NubTypeChar()
{
}
public override string ToString() => "char";
}
public class NubTypeStruct : NubType
{
private static readonly Dictionary<(string Module, string Name), NubTypeStruct> Cache = new();
@@ -324,6 +335,10 @@ public class TypeEncoder
sb.Append('S');
break;
case NubTypeChar:
sb.Append('C');
break;
case NubTypePointer p:
sb.Append("P(");
EncodeType(sb, p.To);
@@ -420,6 +435,7 @@ public class TypeDecoder
'U' => DecodeUInt(),
'I' => DecodeSInt(),
'S' => NubTypeString.Instance,
'C' => NubTypeChar.Instance,
'P' => DecodePointer(),
'F' => DecodeFunc(),
'T' => DecodeStruct(),