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

@@ -1,7 +1,7 @@
// Java source emission for `#jni_main #jni_class("...") { ... }` decls
// (FFI plan, #jni_main pipeline slice 1).
//
// Given a `ForeignClassDecl` whose `is_main` flag is set, emit a `.java`
// Given a `RuntimeClassDecl` whose `is_main` flag is set, emit a `.java`
// source file that:
//
// - declares a `public class` at the foreign_path's package + simple
@@ -83,7 +83,7 @@ pub fn injectLoadLibrary(allocator: Allocator, java_source: []const u8, lib_name
/// heap-allocated through `allocator`; caller owns it.
pub fn emitJavaSource(
allocator: Allocator,
fcd: *const ast.ForeignClassDecl,
fcd: *const ast.RuntimeClassDecl,
opts: Options,
) EmitError![]u8 {
if (!fcd.is_main) return EmitError.NotAJniMainClass;
@@ -221,7 +221,7 @@ fn foreignPathToJavaName(allocator: Allocator, slash_path: []const u8) EmitError
fn emitOverride(
allocator: Allocator,
buf: *std.ArrayList(u8),
md: ast.ForeignMethodDecl,
md: ast.RuntimeMethodDecl,
opts: Options,
) EmitError!void {
// The Java @Override only calls the native delegate. `super.<method>(...)`
@@ -253,7 +253,7 @@ fn emitOverride(
fn emitNativeDecl(
allocator: Allocator,
buf: *std.ArrayList(u8),
md: ast.ForeignMethodDecl,
md: ast.RuntimeMethodDecl,
opts: Options,
) EmitError!void {
try buf.appendSlice(allocator, " private native ");
@@ -281,7 +281,7 @@ fn emitJavaReturnType(
fn emitJavaParamList(
allocator: Allocator,
buf: *std.ArrayList(u8),
md: ast.ForeignMethodDecl,
md: ast.RuntimeMethodDecl,
opts: Options,
) EmitError!void {
const start: usize = if (md.is_static) 0 else 1; // skip self
@@ -296,7 +296,7 @@ fn emitJavaParamList(
fn emitJavaArgList(
allocator: Allocator,
buf: *std.ArrayList(u8),
md: ast.ForeignMethodDecl,
md: ast.RuntimeMethodDecl,
) EmitError!void {
const start: usize = if (md.is_static) 0 else 1;
for (md.param_names[start..], 0..) |name, i| {