`Math :: #jni_class("java/lang/Math") { static abs :: (n: s32) -> s32; }`
should parse, today's 2.2 parser treats `static` as a plain
identifier and errors at the following `abs`. The make-green
follow-up adds a `static` keyword recognition step in the body
loop and an `is_static` flag on `JniMethodDecl`.
20 lines
612 B
Plaintext
20 lines
612 B
Plaintext
// Phase 2 step 2.3 (PLAN-FFI.md): xfail then green for the `static`
|
|
// method body item inside a `#jni_class` declaration.
|
|
//
|
|
// `static name :: (args...) -> Ret;` declares a class/static method —
|
|
// no implicit `self`, dispatched via `GetStaticMethodID` / `CallStatic*`
|
|
// at lowering time (Phase 2.12). Step 2.3 extends `parseJniClassDecl`
|
|
// to recognise the `static` prefix and mark the resulting
|
|
// `JniMethodDecl` with `is_static = true`.
|
|
|
|
#import "modules/std.sx";
|
|
|
|
Math :: #jni_class("java/lang/Math") {
|
|
static abs :: (n: s32) -> s32;
|
|
}
|
|
|
|
main :: () -> s32 {
|
|
print("parse-only ok\n");
|
|
0;
|
|
}
|