stage1 优化重构代码
This commit is contained in:
@@ -252,8 +252,8 @@ spl_expr_result_t spl_parse_struct_literal(spl_comp_t *ctx, spl_type_info_t *typ
|
||||
* so that match arms behave as "enhanced if-conditions".
|
||||
* For enum: parses .VariantName, emits tag comparison, returns variant.
|
||||
* For value: parses expression, emits equality comparison. */
|
||||
spl_enum_variant_t *spl_emit_match_enum_cmp(spl_comp_t *ctx,
|
||||
spl_type_info_t *enum_type, int val_offset);
|
||||
spl_enum_variant_t *spl_emit_match_enum_cmp(spl_comp_t *ctx, spl_type_info_t *enum_type,
|
||||
int val_offset);
|
||||
void spl_emit_match_value_cmp(spl_comp_t *ctx, int val_offset);
|
||||
|
||||
/* ============================================================
|
||||
@@ -292,6 +292,9 @@ int spl_declare_func(spl_comp_t *ctx, const char *name, spl_type_info_t *ret_typ
|
||||
int is_extern, int is_pub);
|
||||
int spl_lookup_func(spl_comp_t *ctx, const char *name);
|
||||
|
||||
/* Ensure a native function is registered for NCALL dispatch, returns index */
|
||||
int spl_ensure_native(spl_comp_t *ctx, const char *name);
|
||||
|
||||
/* String/data management */
|
||||
int spl_add_string(spl_comp_t *ctx, const char *str);
|
||||
int spl_add_global_data(spl_comp_t *ctx, void *data, usize size);
|
||||
|
||||
Reference in New Issue
Block a user