stage0 新增内存复制指令 重构vm交互
This commit is contained in:
1 parent
0b8f649818
commit
40cffa9cb5
22 files changed
+626
-158
No files matched your search
@@ -1136,6 +1136,18 @@ static void sema_bind_pattern(spl_sema_t *sema, spl_ast_node_ref_t pat_ref,
|
||||
case SPL_AST_PATTERN_UNDERSCORE:
|
||||
return;
|
||||
|
||||
case SPL_AST_PATTERN_REF: {
|
||||
if (!matched_tid) {
|
||||
spl_diag_error(sema->diag, SPL_DIAG_KIND_TYPE_MISMATCH, &pat->dbg,
|
||||
"ref pattern requires a concrete type");
|
||||
return;
|
||||
}
|
||||
spl_lang_type_id_t ptr = spl_lang_make_ptr(sema->type, matched_tid);
|
||||
sema_bind_pattern(sema, pat->pattern_ref.pat, ptr);
|
||||
pat->resolved_lang_tid = ptr;
|
||||
return;
|
||||
}
|
||||
|
||||
case SPL_AST_PATTERN_LIST: {
|
||||
for (usize i = 0; i < vec_size(pat->pattern_list.patterns); ++i)
|
||||
sema_bind_pattern(sema, vec_at(pat->pattern_list.patterns, i), matched_tid);
|
||||
|
||||
Reference in new issue
Block a user