This commit is contained in:
nub31
2025-11-03 13:46:25 +01:00
parent 085f7a1a6a
commit f231a45285
4 changed files with 133 additions and 63 deletions

View File

@@ -581,9 +581,25 @@ public class SizeNode(List<Token> tokens, NubType targetType) : RValue(tokens, n
}
}
public class CastNode(List<Token> tokens, NubType type, ExpressionNode value) : RValue(tokens, type)
public class CastNode(List<Token> tokens, NubType type, ExpressionNode value, CastNode.Conversion conversionType) : RValue(tokens, type)
{
public enum Conversion
{
IntToInt,
FloatToFloat,
IntToFloat,
FloatToInt,
PointerToPointer,
PointerToUInt64,
UInt64ToPointer,
ConstArrayToArray,
ConstArrayToSlice,
}
public ExpressionNode Value { get; } = value;
public Conversion ConversionType { get; } = conversionType;
public override IEnumerable<Node> Children()
{