refactor(ffi-linkage): Phase 9.2a — rename runtime-class TYPE names → Runtime* (Decision 5)

Mechanical, collision-free PascalCase renames (object-model axis, not linkage):
ForeignClassDecl→RuntimeClassDecl, ForeignMethodDecl→RuntimeMethodDecl,
ForeignClassMember→RuntimeClassMember, ForeignFieldDecl→RuntimeFieldDecl,
ForeignRuntime→RuntimeKind, ForeignClassPrefix→RuntimeClassPrefix. Snapshot-neutral;
suite green (646/444). Remaining 9.2: snake_case state (foreign_class_map,
current_foreign_class, foreign_path [coupled to .sx hooks], the foreign_class_decl
union variant) + the parse/lower/resolve fn names + ForeignClassDecl.is_foreign flag.
This commit is contained in:
agra
2026-06-15 08:57:53 +03:00
parent 7ffdc7d2a2
commit 3354446412
16 changed files with 129 additions and 129 deletions

View File

@@ -93,7 +93,7 @@ pub const Node = struct {
protocol_decl: ProtocolDecl,
impl_block: ImplBlock,
ffi_intrinsic_call: FfiIntrinsicCall,
foreign_class_decl: ForeignClassDecl,
foreign_class_decl: RuntimeClassDecl,
jni_env_block: JniEnvBlock,
pub fn declName(self: Data) ?[]const u8 {
@@ -836,7 +836,7 @@ pub const ProtocolDecl = struct {
source_file: ?[]const u8 = null,
};
pub const ForeignRuntime = enum {
pub const RuntimeKind = enum {
jni_class,
jni_interface,
objc_class,
@@ -846,7 +846,7 @@ pub const ForeignRuntime = enum {
swift_protocol,
};
pub const ForeignMethodDecl = struct {
pub const RuntimeMethodDecl = struct {
name: []const u8,
params: []const *Node, // type_expr nodes — first is `*Self` for instance methods
param_names: []const []const u8,
@@ -862,7 +862,7 @@ pub const ForeignMethodDecl = struct {
body: ?*Node = null, // sx-side implementation (defined-class only). null = `;`-terminated decl referencing inherited / external method.
};
pub const ForeignFieldDecl = struct {
pub const RuntimeFieldDecl = struct {
name: []const u8,
field_type: *Node, // type_expr node
/// True iff the declaration carries a `#property[(...)]` directive
@@ -876,18 +876,18 @@ pub const ForeignFieldDecl = struct {
property_modifiers: []const []const u8 = &.{},
};
pub const ForeignClassMember = union(enum) {
method: ForeignMethodDecl,
field: ForeignFieldDecl, // JNI runtime only (sema-checked in later step)
pub const RuntimeClassMember = union(enum) {
method: RuntimeMethodDecl,
field: RuntimeFieldDecl, // JNI runtime only (sema-checked in later step)
extends: []const u8, // sx-side alias name (right of `#extends`)
implements: []const u8, // sx-side alias name (right of `#implements`)
};
pub const ForeignClassDecl = struct {
pub const RuntimeClassDecl = struct {
name: []const u8, // sx-side alias (left of `::`)
foreign_path: []const u8, // directive arg: "java/path/Foo" / "NSString" / "Foundation.URL"
runtime: ForeignRuntime,
members: []const ForeignClassMember = &.{},
runtime: RuntimeKind,
members: []const RuntimeClassMember = &.{},
is_foreign: bool = false, // `#foreign #...` prefix — class is provided by the foreign runtime; we only reference it
is_main: bool = false, // `#jni_main` / `#objc_main` — class is the launchable entry (Activity / UIApplicationDelegate / ...)
/// True when the sx-side alias NAME was a backtick raw identifier — exempt