makspll / bevy_mod_scripting

Bevy Scripting Plugin
Apache License 2.0
391 stars 30 forks source link

Proxy derive macros, rustc plugin codegen, safety improvements #67

Closed makspll closed 5 months ago

makspll commented 1 year ago

Macros of the form:

#[reflect(Resource, LuaProxyable)]
#[proxy(languages("on_feature(lua)"), derive(Clone))]
#[functions[
    #[lua(MutatingMethod)]
    fn set_my_string(&mut self, another_string: Option<String>);

    #[lua(Method)]
    fn get_my_string(&self) -> String;

    #[lua(MetaMethod)]
    fn ToString(&self) -> String {
        format!("{:#?}", _self)
    }
]]
makspll commented 10 months ago

This is almost finished, I just have codegen for binary and unary operators left over and that should be it, will also write some solid UI tests and others and voila