switch cast expressions from being formally represented in the expression tree - instead use cast-like tree shapes to perform casts in the ir/typechecking phase. this is odd, given C's casting syntax, but it is much more natural given that the parser is not any longer doing identifier resolution, and as such it fixes a bunch of nasty edge cases.

This commit is contained in:
Ryan Fleury
2025-04-28 11:50:23 -07:00
parent 81425e8b90
commit c62ad20a9a
13 changed files with 325 additions and 130 deletions
+2 -2
View File
@@ -1376,7 +1376,7 @@ rdi_eval_typegroup_conversion_kind_matrix:
@data(`struct {RDI_U8 *str; RDI_U64 size;}`) @c_file
rdi_eval_conversion_kind_message_string_table:
{
@expand(RDI_EvalTypeGroupTable a) `{(RDI_U8 *)"$(a.error_string)", sizeof("$(a.error_string)")}`
@expand(RDI_EvalConversionKindTable a) `{(RDI_U8 *)"$(a.error_string)", sizeof("$(a.error_string)")}`
}
////////////////////////////////
@@ -1503,7 +1503,7 @@ rdi_hash(RDI_U8 *ptr, RDI_U64 size)
@expand(RDI_TypeKindTable a) ` case RDI_TypeKind_$(a.name): {result = (RDI_U8*)"$(a.name)"; *size_out = sizeof("$(a.name)")-1;}break;`,
`}`;
`return result;`;
`}`;
`}`;
``;
}