This commit is contained in:
nub31
2025-09-20 23:32:19 +02:00
parent a764c67720
commit d96e6cf41a
3 changed files with 35 additions and 14 deletions

View File

@@ -837,13 +837,13 @@ public sealed class TypeChecker
BoolTypeSyntax => new NubBoolType(),
CStringTypeSyntax => new NubCStringType(),
IntTypeSyntax i => new NubIntType(i.Signed, i.Width),
CustomTypeSyntax c => ResolveCustomType(c),
FloatTypeSyntax f => new NubFloatType(f.Width),
FuncTypeSyntax func => new NubFuncType(func.Parameters.Select(ResolveType).ToList(), ResolveType(func.ReturnType)),
ArrayTypeSyntax arr => new NubArrayType(ResolveType(arr.BaseType)),
PointerTypeSyntax ptr => new NubPointerType(ResolveType(ptr.BaseType)),
StringTypeSyntax => new NubStringType(),
TemplateTypeSyntax template => throw new NotImplementedException(),
CustomTypeSyntax c => ResolveCustomType(c),
TemplateTypeSyntax t => ResolveTemplateType(t),
VoidTypeSyntax => new NubVoidType(),
_ => throw new NotSupportedException($"Unknown type syntax: {type}")
};
@@ -907,6 +907,11 @@ public sealed class TypeChecker
_resolvingTypes.Remove(key);
}
}
private NubType ResolveTemplateType(TemplateTypeSyntax template)
{
throw new NotImplementedException();
}
}
public enum VariableKind