13 JNI examples migrated (1410-1419/1423/1424/1425): import runtime classes
'#foreign #jni_class("X") {' → '#jni_class("X") extern {'. 1417 (all-runtimes)
also exercises #jni_interface/#objc_class/#objc_protocol/#swift_class/#swift_struct/
#swift_protocol — all take the postfix modifier (verified by probe), migrated via a
generalized '#foreign #<directive>("X") {' → '… extern {' rewrite. No 14xx snapshot
asserts on 'foreign'; empty snapshot diff, corpus-validated.
KEPT comment-only #foreign in 1426 (jni-extern-class test, no decls). Suite green
(647 corpus / 444 unit, 0 failed).
20 lines
559 B
Plaintext
20 lines
559 B
Plaintext
// Phase 2 step 2.5 (PLAN-FFI.md): xfail then green for the field body
|
|
// item inside a `#jni_class` declaration.
|
|
//
|
|
// `name: Type;` declares an instance field backed by JNI's
|
|
// `Get<Type>Field` / `Set<Type>Field` family at lowering time (2.13).
|
|
// Step 2.5 extends `parseJniClassDecl` to recognise the colon between
|
|
// name and type as the field-decl indicator (vs the `::` of a method).
|
|
|
|
#import "modules/std.sx";
|
|
|
|
Point :: #jni_class("android/graphics/Point") extern {
|
|
x: i32;
|
|
y: i32;
|
|
}
|
|
|
|
main :: () -> i32 {
|
|
print("parse-only ok\n");
|
|
0
|
|
}
|