refactor(ffi-linkage): Phase 9.3-src — purge 'foreign' from src/ comments + a user-facing diagnostic
Reword every 'foreign' comment to the extern/runtime-class vocabulary matching the renamed identifiers (foreign call→extern call, foreign class→runtime class, foreign path→runtime path, the #foreign-literal comment mentions → extern, etc.). Also fixes two USER-FACING issues: the 'expected … #foreign … after type annotation' parse error no longer advertises the removed keyword, and the Android 'no #jni_main' help diagnostic now shows '#jni_class(…) extern' instead of the rejected '#foreign #jni_class'. Removed the now-dead prefix-#foreign-vs-postfix conflict branch in parseRuntimeClassDecl (the caller rejects #foreign before it runs). src/ now contains 'foreign' ONLY in the hash_foreign token machinery + its 4 rejection messages — the deprecation mechanism (kept per the 9.0 recommendation; the message MUST name #foreign to guide migration). Snapshot-neutral; suite green (646 corpus / 444 unit, 0 failed).
This commit is contained in:
@@ -24,7 +24,7 @@
|
||||
// f32/f64)
|
||||
// - `(self: *Self)` plus primitive params
|
||||
// - cross-class refs (`*Foo` where Foo is another declared
|
||||
// `#foreign #jni_class`) lower to Foo's foreign path → Java
|
||||
// `#jni_class(…) extern`) lower to Foo's runtime path → Java
|
||||
// fully-qualified type
|
||||
// - `*void` → `Object` (opaque jobject)
|
||||
|
||||
@@ -39,7 +39,7 @@ pub const EmitError = error{
|
||||
};
|
||||
|
||||
pub const Options = struct {
|
||||
/// Map from sx alias → foreign path of declared `#jni_class` decls.
|
||||
/// Map from sx alias → runtime path of declared `#jni_class` decls.
|
||||
/// Used to resolve `*Foo` cross-class refs in method signatures.
|
||||
classes: ?*const std.StringHashMap([]const u8) = null,
|
||||
/// Default superclass when the user doesn't write `#extends ...;`.
|
||||
@@ -79,7 +79,7 @@ pub fn injectLoadLibrary(allocator: Allocator, java_source: []const u8, lib_name
|
||||
return try buf.toOwnedSlice(allocator);
|
||||
}
|
||||
|
||||
/// Emit a `.java` source for the given foreign-class decl. Result is
|
||||
/// Emit a `.java` source for the given runtime-class decl. Result is
|
||||
/// heap-allocated through `allocator`; caller owns it.
|
||||
pub fn emitJavaSource(
|
||||
allocator: Allocator,
|
||||
|
||||
Reference in New Issue
Block a user