refactor(ffi-linkage): Phase 9.3 — purge remaining 'foreign' from library/docs/example comments

Capital-Foreign + stale-identifier comment refs: library (Foreign Java types→Runtime,
foreign-class→runtime-class, foreign_class_map→runtime_class_map); docs/debugger
(foreign call→extern call); docs/fork-c ledger (foreign_class_map, protocol/foreign→
runtime-class); docs/inline-asm-design Deviation-6 obsolete #foreign-vs-extern design
RESOLVED to the landed extern/export reality; example comments (parseForeignClassDecl→
parseRuntimeClassDecl, checkForeignRefs→checkExternRefs, Foreign decls→Extern). Docs/
comments only — no build impact.
This commit is contained in:
agra
2026-06-15 11:03:29 +03:00
parent dfae690b31
commit 9719432e79
14 changed files with 32 additions and 34 deletions

View File

@@ -10,7 +10,7 @@
// ─── Obj-C primitive type aliases ───────────────────────────────────────
// Named stand-ins for the three opaque Obj-C runtime types. They all
// resolve to `*void` at the LLVM layer (no runtime cost) but improve
// readability in foreign-class declarations and call sites.
// readability in runtime-class declarations and call sites.
//
// id — any Obj-C instance pointer
// Class — a class object pointer
@@ -80,7 +80,7 @@ NSLog :: (fmt: *NSString) extern;
// `defer view.release();` and `view.retain()` directly instead of going
// through `objc_msgSend` casts. M2.3's `#extends`-aware dispatch finds
// these methods automatically once a class roots its `#extends` chain at
// NSObject (foreign classes in uikit.sx etc. add `#extends NSObject;` to
// NSObject (runtime classes in uikit.sx etc. add `#extends NSObject;` to
// inherit the surface).
//
// `release` is NOT a reserved keyword in sx — modern clang ARC bans

View File

@@ -36,7 +36,7 @@
#import "modules/platform/types.sx";
#import "modules/platform/api.sx";
// ── Foreign Java types ──────────────────────────────────────────────────
// ── Runtime Java types ──────────────────────────────────────────────────
Bundle :: #jni_class("android/os/Bundle") extern { }
JContext :: #jni_class("android/content/Context") extern {
@@ -66,7 +66,7 @@ ActivityClass :: #jni_class("android/app/Activity") extern {
setContentView :: (self: *Self, v: *JView);
}
// ── Foreign C/NDK decls ─────────────────────────────────────────────────
// ── Extern C/NDK decls ─────────────────────────────────────────────────
// C side of file_utils — installs the AAssetManager so `read_file_bytes`
// can route through `AAssetManager_open` when running on Android.

View File

@@ -7,7 +7,7 @@
// `View` in particular collides with `modules/ui/view.sx`'s protocol.
// Inside the namespace these are referenced as `Jni.Activity`,
// `Jni.Window`, etc. The compiler registers the decls both qualified
// and bare in `foreign_class_map`, so cross-class refs in method
// and bare in `runtime_class_map`, so cross-class refs in method
// signatures (`getWindow :: (self: *Self) -> *Window`) still resolve
// against the bare name within the namespace.