refactor(ffi-linkage): Phase 9.2b — rename runtime-class fns + state → runtime_* / is_reference

The runtime-class object-model identifiers (Decision 5): parse/lower/find/resolve/
register/stamp fns Foreign→Runtime (parseRuntimeClassDecl, lowerRuntimeMethodCall,
findRuntimeMethodInChain, resolveRuntimeMethodReturnType, registerRuntimeClassDecl,
runtimeClassStructType, runtimeKindForOffset, …); state foreign_class_map→
runtime_class_map, current_foreign_class/_method→current_runtime_*, the
foreign_class_decl union variant→runtime_class_decl, foreign_method/static/instance/
class→runtime_*; and the reference-vs-define flag is_foreign→is_reference (+
is_foreign_eff→is_reference_eff) now that it only lives on RuntimeClassDecl.
Snapshot-neutral; suite green (646/444).

Remaining 9.2: the foreign_path family (coupled .sx hooks: jni_main_foreign_path_at
spans build.sx/bundle.sx/compiler_hooks.zig/specs.md) + the extern-ref validators
(checkForeignRefs etc. → Extern, linkage not runtime) + bare 'foreign' comments.
This commit is contained in:
agra
2026-06-15 09:01:04 +03:00
parent 3354446412
commit 5c8af6eb73
22 changed files with 205 additions and 205 deletions

View File

@@ -1332,16 +1332,16 @@ pub const Analyzer = struct {
}
}
},
.foreign_class_decl => |fd| {
.runtime_class_decl => |fd| {
try self.addSymbol(fd.name, .type_alias, null, node.span);
if (fd.is_foreign and fd.is_main) {
if (fd.is_reference and fd.is_main) {
try self.diagnostics.append(self.allocator, .{
.level = .err,
.message = "'#foreign' and '#jni_main' / '#objc_main' are mutually exclusive — a foreign-referenced class can't be the app's main entry",
.span = node.span,
});
}
if (fd.is_foreign) {
if (fd.is_reference) {
for (fd.members) |m| switch (m) {
.method => |md| if (md.body != null) {
try self.diagnostics.append(self.allocator, .{
@@ -1784,7 +1784,7 @@ pub fn findNodeAtOffset(node: *Node, offset: u32) ?*Node {
.tuple_type_expr,
.ufcs_alias,
.closure_type_expr,
.foreign_class_decl,
.runtime_class_decl,
=> {},
.jni_env_block => |eb| {
if (findNodeAtOffset(eb.env, offset)) |found| return found;