Allow alias export directive with extern scopes
Its-Kenta opened this issue · 2 comments
Its-Kenta commented
Currently only alias export directive possible is if you call it individually outside a namescope and if not inside an extern "C" {}
scope:
[export("MyFunction")]
extern "C" fn my_function(): i32;
I think it would be great if you could include the export directive to be part of a the extern scope like this:
[link("mylib")]
namespace lib {
extern "C" {
[export("MyFunction")]
fn my_function(): i32;
}
}
Meaning extern
in the fn get_screen_width(): i32;
is unnecessary and allows for bundling all imports in one scope for cleaner code (imo.)
Currently attempting this would give the following error:
=> [syntax]: expect function or variable declaration
7 | [export("MyFunction")]
| ^-here
Spydr06 commented
I'll look into it.
It's a bit more complicated to implement rn, since it interferes with how the compiler directives are implemented currently, but it should be doable
Spydr06 commented
Fixed this a while ago, this can be closed.