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:
19
examples/ffi-jni-class-05-field.sx
Normal file
19
examples/ffi-jni-class-05-field.sx
Normal 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;
|
||||
}
|
||||
Reference in New Issue
Block a user