ffi 2.5 xfail: name: Type; field body item in #jni_class

`Point :: #jni_class("...") { x: s32; y: s32; }` should parse,
today's 2.4 body loop sees the identifier `x`, expects `::`, hits
`:` and errors. The make-green follow-up adds a `field` variant to
`JniClassMember` and a parser branch that detects `<ident>:` (vs
`<ident>::`) as the field-decl indicator.
This commit is contained in:
agra
2026-05-20 10:03:54 +03:00
parent a5c6f754a8
commit 1dee9ba67b
3 changed files with 21 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
// 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") {
x: s32;
y: s32;
}
main :: () -> s32 {
print("parse-only ok\n");
0;
}