diff --git a/examples/ffi-jni-class-05-field.sx b/examples/ffi-jni-class-05-field.sx new file mode 100644 index 0000000..46220f8 --- /dev/null +++ b/examples/ffi-jni-class-05-field.sx @@ -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 +// `GetField` / `SetField` 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; +} diff --git a/tests/expected/ffi-jni-class-05-field.exit b/tests/expected/ffi-jni-class-05-field.exit new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/tests/expected/ffi-jni-class-05-field.exit @@ -0,0 +1 @@ +1 diff --git a/tests/expected/ffi-jni-class-05-field.txt b/tests/expected/ffi-jni-class-05-field.txt new file mode 100644 index 0000000..ebca0b9 --- /dev/null +++ b/tests/expected/ffi-jni-class-05-field.txt @@ -0,0 +1 @@ +/Users/agra/projects/sx/examples/ffi-jni-class-05-field.sx:12:6: error: expected '::'