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:
@@ -193,9 +193,9 @@ sm_first :: (a: i32, b: i32) -> (i32, !) {
|
||||
return v;
|
||||
}
|
||||
|
||||
// --- Foreign function binding ---
|
||||
// --- Extern function binding ---
|
||||
|
||||
// --- Foreign function binding ---
|
||||
// --- Extern function binding ---
|
||||
libc :: #library "c";
|
||||
|
||||
c_abs :: (n: i32) -> i32 extern libc "abs";
|
||||
|
||||
@@ -14,7 +14,7 @@ c_abs :: (n: i32) -> i32 extern libc "abs";
|
||||
main :: () {
|
||||
|
||||
// ========================================================
|
||||
// 15. FOREIGN FUNCTION BINDING
|
||||
// 15. EXTERN FUNCTION BINDING
|
||||
// ========================================================
|
||||
print("=== 15. Extern ===\n");
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// `#import c` extern-name exemption: C names that collide with sx's reserved
|
||||
// type spellings import unedited. Foreign decls are treated as RAW — their names
|
||||
// type spellings import unedited. Extern decls are treated as RAW — their names
|
||||
// are never type-classified nor reserved-checked — so the generated `extern`
|
||||
// bindings import and call without hand-edits (no backticks needed). This covers
|
||||
// parameter names (`i1`/`i2`), a function whose own NAME is a reserved spelling
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Foreign `-> [:0]u8` / `-> ?[:0]u8` returns: C hands back ONE `char *`;
|
||||
// Extern `-> [:0]u8` / `-> ?[:0]u8` returns: C hands back ONE `char *`;
|
||||
// the fat sx string is synthesized at the call boundary ({ptr, strlen};
|
||||
// NULL maps to the optional's null / an empty string) — issue 0128.
|
||||
// Pre-fix, the call read the pointer register pair as {ptr, len} and the
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
// diagnostic — the bogus library reference is caught BEFORE the symbol
|
||||
// would silently resolve through whatever image happens to carry it.
|
||||
//
|
||||
// Regression (FFI-linkage Part B): `checkForeignRefs` validated only a
|
||||
// Regression (FFI-linkage Part B): `checkExternRefs` validated only a
|
||||
// `extern` (extern-import shape) library_ref and skipped the `extern` keyword's
|
||||
// `extern_lib`, so a bogus `extern` lib reference compiled silently (the
|
||||
// symbol resolved via the default image and ran). Prerequisite for
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// M1.0 (xfail) — '=>' expression-body form inside '#objc_class'
|
||||
// member methods.
|
||||
//
|
||||
// Today: parseForeignClassDecl ([src/parser.zig:1262]) accepts ';'
|
||||
// Today: parseRuntimeClassDecl ([src/parser.zig:1262]) accepts ';'
|
||||
// (declaration) or '{ ... }' (block body) but not '=>'. Trying
|
||||
// '=>' surfaces 'expected ;' at the arrow.
|
||||
//
|
||||
|
||||
@@ -30,7 +30,7 @@ probe_set_tag :: (self: *void, _cmd: *void, v: i32) callconv(.c) {
|
||||
g_probe_tag = v;
|
||||
}
|
||||
|
||||
// Foreign declaration with #property on `tag`.
|
||||
// Extern declaration with #property on `tag`.
|
||||
SxPropProbe :: #objc_class("SxPropProbe") extern {
|
||||
alloc :: () -> *SxPropProbe;
|
||||
init :: (self: *SxPropProbe) -> *SxPropProbe;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// M2.3 — `#extends ForeignClass` method-resolution chaining.
|
||||
// M2.3 — `#extends a runtime class` method-resolution chaining.
|
||||
//
|
||||
// When `obj.method()` is called on a runtime-class pointer and
|
||||
// `method` isn't declared directly on the receiver's class, the
|
||||
|
||||
Reference in New Issue
Block a user