Compare commits
11 Commits
raw-pointe
...
superclass
| Author | SHA1 | Date | |
|---|---|---|---|
| 16139847f9 | |||
| 751d4f4fb9 | |||
| 66d9279445 | |||
| b765f4cb21 | |||
| 4f65c35407 | |||
| 90609f4ad4 | |||
| ff76f3c865 | |||
| ededfd9e55 | |||
| e2c74b8dfe | |||
| 701897b00d | |||
| 930ac1c331 |
2
Cargo.lock
generated
2
Cargo.lock
generated
@@ -318,7 +318,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "roblox_emulator"
|
name = "roblox_emulator"
|
||||||
version = "0.1.0"
|
version = "0.2.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"glam",
|
"glam",
|
||||||
"mlua",
|
"mlua",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "roblox_emulator"
|
name = "roblox_emulator"
|
||||||
version = "0.1.0"
|
version = "0.2.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
repository = "https://git.itzana.me/StrafesNET/roblox_emulator"
|
repository = "https://git.itzana.me/StrafesNET/roblox_emulator"
|
||||||
license = "MIT OR Apache-2.0"
|
license = "MIT OR Apache-2.0"
|
||||||
|
|||||||
@@ -2,12 +2,14 @@ use rbx_dom_weak::{types::Ref,WeakDom};
|
|||||||
|
|
||||||
pub fn class_is_a(class:&str,superclass:&str)->bool{
|
pub fn class_is_a(class:&str,superclass:&str)->bool{
|
||||||
class==superclass
|
class==superclass
|
||||||
||rbx_reflection_database::get().classes.get(class)
|
||{
|
||||||
.is_some_and(|descriptor|
|
let db=rbx_reflection_database::get();
|
||||||
descriptor.superclass.as_ref().is_some_and(|class_super|
|
match (db.classes.get(class),db.classes.get(superclass)){
|
||||||
class_is_a(class_super,superclass)
|
(Some(class),Some(superclass))=>db.superclasses_iter(class)
|
||||||
)
|
.any(|cls|core::ptr::addr_eq(cls,superclass)),
|
||||||
)
|
_=>false
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[repr(transparent)]
|
#[repr(transparent)]
|
||||||
@@ -28,7 +30,7 @@ impl Context{
|
|||||||
class_is_a(instance.class.as_ref(),superclass)
|
class_is_a(instance.class.as_ref(),superclass)
|
||||||
).map(|instance|instance.referent())
|
).map(|instance|instance.referent())
|
||||||
}
|
}
|
||||||
pub fn scripts(&self)->Vec<crate::script::Script>{
|
pub fn scripts(&self)->Vec<crate::runner::instance::Script>{
|
||||||
self.superclass_iter("LuaSourceContainer").map(crate::script::Script::new).collect()
|
self.superclass_iter("LuaSourceContainer").map(crate::runner::instance::Script::new).collect()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,5 @@
|
|||||||
pub mod script;
|
|
||||||
pub mod context;
|
pub mod context;
|
||||||
|
|
||||||
pub mod runner;
|
pub mod runner;
|
||||||
|
|
||||||
pub type Result<T>=core::result::Result<T,script::Error>;
|
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests;
|
mod tests;
|
||||||
|
|||||||
@@ -43,9 +43,9 @@ impl mlua::UserData for CFrame{
|
|||||||
}
|
}
|
||||||
impl<'lua> mlua::FromLua<'lua> for CFrame{
|
impl<'lua> mlua::FromLua<'lua> for CFrame{
|
||||||
fn from_lua(value:mlua::prelude::LuaValue<'lua>,_lua:&'lua mlua::prelude::Lua)->mlua::prelude::LuaResult<Self>{
|
fn from_lua(value:mlua::prelude::LuaValue<'lua>,_lua:&'lua mlua::prelude::Lua)->mlua::prelude::LuaResult<Self>{
|
||||||
match value {
|
match value{
|
||||||
mlua::Value::UserData(ud) => Ok(*ud.borrow::<Self>()?),
|
mlua::Value::UserData(ud)=>ud.take()?,
|
||||||
_ => unreachable!(),
|
other=>Err(mlua::Error::runtime(format!("Expected CFrame got {:?}",other))),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,36 +1,15 @@
|
|||||||
|
use rbx_types::Ref;
|
||||||
use rbx_dom_weak::WeakDom;
|
use rbx_dom_weak::WeakDom;
|
||||||
|
|
||||||
use super::vector3::Vector3;
|
use super::vector3::Vector3;
|
||||||
|
|
||||||
pub struct Instance{
|
|
||||||
referent:rbx_types::Ref,
|
|
||||||
}
|
|
||||||
|
|
||||||
impl From<crate::script::Script> for Instance{
|
|
||||||
fn from(value:crate::script::Script)->Self{
|
|
||||||
Self{referent:value.script}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl Instance{
|
|
||||||
pub const fn new(referent:rbx_types::Ref)->Self{
|
|
||||||
Self{referent}
|
|
||||||
}
|
|
||||||
pub fn get<'a>(&'a self,dom:&'a WeakDom)->mlua::Result<&'a rbx_dom_weak::Instance>{
|
|
||||||
dom.get_by_ref(self.referent).ok_or(mlua::Error::runtime("Instance missing"))
|
|
||||||
}
|
|
||||||
pub fn get_mut<'a>(&'a self,dom:&'a mut WeakDom)->mlua::Result<&'a mut rbx_dom_weak::Instance>{
|
|
||||||
dom.get_by_ref_mut(self.referent).ok_or(mlua::Error::runtime("Instance missing"))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// LMAO look at this function!
|
// LMAO look at this function!
|
||||||
fn dom<T>(lua:&mlua::Lua,mut f:impl FnMut(&mut WeakDom)->mlua::Result<T>)->mlua::Result<T>{
|
fn dom<T>(lua:&mlua::Lua,mut f:impl FnMut(&mut WeakDom)->mlua::Result<T>)->mlua::Result<T>{
|
||||||
let mut dom=lua.app_data_mut::<&'static mut WeakDom>().ok_or(mlua::Error::runtime("DataModel missing"))?;
|
let mut dom=lua.app_data_mut::<&'static mut WeakDom>().ok_or(mlua::Error::runtime("DataModel missing"))?;
|
||||||
f(&mut *dom)
|
f(&mut *dom)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn coerce_float(value:&mlua::Value)->Option<f32>{
|
fn coerce_float32(value:&mlua::Value)->Option<f32>{
|
||||||
match value{
|
match value{
|
||||||
&mlua::Value::Integer(i)=>Some(i as f32),
|
&mlua::Value::Integer(i)=>Some(i as f32),
|
||||||
&mlua::Value::Number(f)=>Some(f as f32),
|
&mlua::Value::Number(f)=>Some(f as f32),
|
||||||
@@ -38,8 +17,75 @@ fn coerce_float(value:&mlua::Value)->Option<f32>{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl mlua::UserData for Instance{
|
fn get_full_name(dom:&rbx_dom_weak::WeakDom,instance:&rbx_dom_weak::Instance)->String{
|
||||||
fn add_fields<'lua,F:mlua::UserDataFields<'lua,Self>>(fields:&mut F){
|
let mut full_name=instance.name.clone();
|
||||||
|
let mut pref=instance.parent();
|
||||||
|
while let Some(parent)=dom.get_by_ref(pref){
|
||||||
|
full_name.insert(0,'.');
|
||||||
|
full_name.insert_str(0,parent.name.as_str());
|
||||||
|
pref=parent.parent();
|
||||||
|
}
|
||||||
|
full_name
|
||||||
|
}
|
||||||
|
|
||||||
|
trait Referent{
|
||||||
|
fn referent(&self)->Ref;
|
||||||
|
fn get<'a>(&self,dom:&'a WeakDom)->mlua::Result<&'a rbx_dom_weak::Instance>{
|
||||||
|
dom.get_by_ref(self.referent()).ok_or(mlua::Error::runtime("Instance missing"))
|
||||||
|
}
|
||||||
|
fn get_mut<'a>(&self,dom:&'a mut WeakDom)->mlua::Result<&'a mut rbx_dom_weak::Instance>{
|
||||||
|
dom.get_by_ref_mut(self.referent()).ok_or(mlua::Error::runtime("Instance missing"))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
macro_rules! class{
|
||||||
|
($class:ident)=>{
|
||||||
|
pub struct $class{
|
||||||
|
referent:Ref,
|
||||||
|
}
|
||||||
|
impl $class{
|
||||||
|
pub const fn new(referent:Ref)->Self{
|
||||||
|
Self{referent}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
impl Referent for $class{
|
||||||
|
fn referent(&self)->Ref{
|
||||||
|
self.referent
|
||||||
|
}
|
||||||
|
}
|
||||||
|
impl<'lua> mlua::FromLua<'lua> for $class{
|
||||||
|
fn from_lua(value:mlua::Value<'lua>,_lua:&'lua mlua::Lua)->mlua::Result<Self>{
|
||||||
|
match value{
|
||||||
|
mlua::Value::UserData(ud)=>ud.take(),
|
||||||
|
other=>Err(mlua::Error::runtime(format!("Expected {} got {:?}",stringify!($class),other))),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
macro_rules! class_composition{
|
||||||
|
($class:ident,($($superclass:ident),*))=>{
|
||||||
|
impl mlua::UserData for $class{
|
||||||
|
fn add_fields<'lua,F:mlua::UserDataFields<'lua,Self>>(fields:&mut F){
|
||||||
|
$(
|
||||||
|
$superclass::composition_add_fields(fields);
|
||||||
|
)*
|
||||||
|
}
|
||||||
|
fn add_methods<'lua,M:mlua::UserDataMethods<'lua,Self>>(methods:&mut M){
|
||||||
|
$(
|
||||||
|
$superclass::composition_add_methods(methods);
|
||||||
|
)*
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
class!(Instance);
|
||||||
|
class_composition!(Instance,(Instance));
|
||||||
|
|
||||||
|
impl Instance{
|
||||||
|
fn composition_add_fields<'lua,T:Referent,F:mlua::UserDataFields<'lua,T>>(fields:&mut F){
|
||||||
fields.add_field_method_get("Parent",|lua,this|{
|
fields.add_field_method_get("Parent",|lua,this|{
|
||||||
dom(lua,|dom|{
|
dom(lua,|dom|{
|
||||||
let instance=this.get(dom)?;
|
let instance=this.get(dom)?;
|
||||||
@@ -48,13 +94,26 @@ impl mlua::UserData for Instance{
|
|||||||
});
|
});
|
||||||
fields.add_field_method_set("Parent",|lua,this,val:Self|{
|
fields.add_field_method_set("Parent",|lua,this,val:Self|{
|
||||||
dom(lua,|dom|{
|
dom(lua,|dom|{
|
||||||
dom.transfer_within(this.referent,val.referent);
|
dom.transfer_within(this.referent(),val.referent);
|
||||||
|
Ok(())
|
||||||
|
})
|
||||||
|
});
|
||||||
|
fields.add_field_method_get("Name",|lua,this|{
|
||||||
|
dom(lua,|dom|{
|
||||||
|
let instance=this.get(dom)?;
|
||||||
|
Ok(instance.name.clone())
|
||||||
|
})
|
||||||
|
});
|
||||||
|
fields.add_field_method_set("Name",|lua,this,val:String|{
|
||||||
|
dom(lua,move|dom|{
|
||||||
|
let instance=this.get_mut(dom)?;
|
||||||
|
//Why does this need to be cloned?
|
||||||
|
instance.name=val.clone();
|
||||||
Ok(())
|
Ok(())
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
fn composition_add_methods<'lua,T:Referent,M:mlua::UserDataMethods<'lua,T>>(methods:&mut M){
|
||||||
fn add_methods<'lua,M:mlua::UserDataMethods<'lua,Self>>(methods:&mut M){
|
|
||||||
methods.add_method("GetChildren",|lua,this,_:()|
|
methods.add_method("GetChildren",|lua,this,_:()|
|
||||||
dom(lua,|dom|{
|
dom(lua,|dom|{
|
||||||
let instance=this.get(dom)?;
|
let instance=this.get(dom)?;
|
||||||
@@ -70,7 +129,7 @@ impl mlua::UserData for Instance{
|
|||||||
methods.add_method("GetDescendants",|lua,this,_:()|
|
methods.add_method("GetDescendants",|lua,this,_:()|
|
||||||
dom(lua,|dom|{
|
dom(lua,|dom|{
|
||||||
let children:Vec<_>=dom
|
let children:Vec<_>=dom
|
||||||
.descendants_of(this.referent)
|
.descendants_of(this.referent())
|
||||||
.map(|instance|
|
.map(|instance|
|
||||||
Instance::new(instance.referent())
|
Instance::new(instance.referent())
|
||||||
)
|
)
|
||||||
@@ -86,17 +145,19 @@ impl mlua::UserData for Instance{
|
|||||||
);
|
);
|
||||||
methods.add_meta_function(mlua::MetaMethod::NewIndex,|lua,(this,index,value):(Self,mlua::String,mlua::Value)|
|
methods.add_meta_function(mlua::MetaMethod::NewIndex,|lua,(this,index,value):(Self,mlua::String,mlua::Value)|
|
||||||
dom(lua,|dom|{
|
dom(lua,|dom|{
|
||||||
|
//println!("__newindex t={this:?} i={index:?} v={value:?}");
|
||||||
let instance=this.get_mut(dom)?;
|
let instance=this.get_mut(dom)?;
|
||||||
let index_str=index.to_str()?;
|
let index_str=index.to_str()?;
|
||||||
let class=rbx_reflection_database::get().classes.get(instance.class.as_str()).ok_or(mlua::Error::runtime("Class missing"))?;
|
let db=rbx_reflection_database::get();
|
||||||
let property=class.default_properties.get(index_str).ok_or(mlua::Error::runtime(format!("Property '{index_str}' missing on class '{}'",class.name)))?;
|
let class=db.classes.get(instance.class.as_str()).ok_or(mlua::Error::runtime("Class missing"))?;
|
||||||
|
let property=db.find_default_property(class,index_str).ok_or(mlua::Error::runtime(format!("Property '{index_str}' missing on class '{}'",class.name)))?;
|
||||||
match property{
|
match property{
|
||||||
rbx_types::Variant::Vector3(_)=>{
|
rbx_types::Variant::Vector3(_)=>{
|
||||||
let typed_value:Vector3=value.as_userdata().ok_or(mlua::Error::runtime("Expected Userdata"))?.take()?;
|
let typed_value:Vector3=value.as_userdata().ok_or(mlua::Error::runtime("Expected Userdata"))?.take()?;
|
||||||
instance.properties.insert(index_str.to_owned(),rbx_types::Variant::Vector3(typed_value.into()));
|
instance.properties.insert(index_str.to_owned(),rbx_types::Variant::Vector3(typed_value.into()));
|
||||||
},
|
},
|
||||||
rbx_types::Variant::Float32(_)=>{
|
rbx_types::Variant::Float32(_)=>{
|
||||||
let typed_value:f32=coerce_float(&value).ok_or(mlua::Error::runtime("Expected f32"))?;
|
let typed_value:f32=coerce_float32(&value).ok_or(mlua::Error::runtime("Expected f32"))?;
|
||||||
instance.properties.insert(index_str.to_owned(),rbx_types::Variant::Float32(typed_value));
|
instance.properties.insert(index_str.to_owned(),rbx_types::Variant::Float32(typed_value));
|
||||||
},
|
},
|
||||||
other=>println!("Unimplemented property type: {other:?}"),
|
other=>println!("Unimplemented property type: {other:?}"),
|
||||||
@@ -107,11 +168,41 @@ impl mlua::UserData for Instance{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'lua> mlua::FromLua<'lua> for Instance{
|
class!(DataModel);
|
||||||
fn from_lua(value:mlua::prelude::LuaValue<'lua>,_lua:&'lua mlua::prelude::Lua)->mlua::prelude::LuaResult<Self>{
|
class_composition!(DataModel,(Instance,DataModel));
|
||||||
match value{
|
impl DataModel{
|
||||||
mlua::Value::UserData(ud)=>ud.take(),
|
fn composition_add_fields<'lua,T:Referent,F:mlua::UserDataFields<'lua,T>>(fields:&mut F){
|
||||||
other=>Err(mlua::Error::runtime(format!("Expected Instance got {:?}",other))),
|
}
|
||||||
}
|
fn composition_add_methods<'lua,T,M:mlua::UserDataMethods<'lua,T>>(methods:&mut M){
|
||||||
|
methods.add_method("GetService",|lua,this,service:String|
|
||||||
|
dom(lua,|dom|{
|
||||||
|
match service.as_str(){
|
||||||
|
//"Lighting"=>Ok(Lighting::new()),
|
||||||
|
other=>Err::<(),_>(mlua::Error::runtime("Service '{other}' not supported")),
|
||||||
|
}
|
||||||
|
})
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class!(Lighting);
|
||||||
|
class_composition!(Lighting,(Instance));
|
||||||
|
|
||||||
|
#[derive(Debug)]
|
||||||
|
pub enum GetScriptError{
|
||||||
|
NoScript,
|
||||||
|
NoSource,
|
||||||
|
}
|
||||||
|
|
||||||
|
class!(Script);
|
||||||
|
class_composition!(Script,(Instance));
|
||||||
|
impl Script{
|
||||||
|
pub fn get_name_source(&self,context:&crate::context::Context)->Result<(String,String),GetScriptError>{
|
||||||
|
let instance=context.dom.get_by_ref(self.referent).ok_or(GetScriptError::NoScript)?;
|
||||||
|
let source=match instance.properties.get("Source").ok_or(GetScriptError::NoSource)?{
|
||||||
|
rbx_dom_weak::types::Variant::String(s)=>s.clone(),
|
||||||
|
_=>Err(GetScriptError::NoSource)?,
|
||||||
|
};
|
||||||
|
Ok((get_full_name(&context.dom,instance),source))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,6 @@ mod runner;
|
|||||||
|
|
||||||
mod cframe;
|
mod cframe;
|
||||||
mod vector3;
|
mod vector3;
|
||||||
mod instance;
|
pub mod instance;
|
||||||
|
|
||||||
pub use runner::Runner;
|
pub use runner::Runner;
|
||||||
|
|||||||
@@ -8,16 +8,19 @@ pub struct Runner{
|
|||||||
}
|
}
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub enum Error{
|
pub enum Error{
|
||||||
Lua(mlua::Error),
|
Lua{
|
||||||
Script(crate::script::Error),
|
source:String,
|
||||||
|
error:mlua::Error
|
||||||
|
},
|
||||||
|
Script(super::instance::GetScriptError),
|
||||||
/// If the lua.remove_app_data function fails
|
/// If the lua.remove_app_data function fails
|
||||||
RemoveAppData,
|
RemoveAppData,
|
||||||
}
|
}
|
||||||
impl Error{
|
impl Error{
|
||||||
pub fn print(self){
|
pub fn print(self){
|
||||||
match self{
|
match self{
|
||||||
Self::Lua(mlua::Error::RuntimeError(s))=>{
|
Self::Lua{source,error:mlua::Error::RuntimeError(s)}=>{
|
||||||
println!("lua error: {s}");
|
println!("lua error: {s}\nsource:{source}");
|
||||||
},
|
},
|
||||||
other=>println!("{:?}",other),
|
other=>println!("{:?}",other),
|
||||||
}
|
}
|
||||||
@@ -76,16 +79,16 @@ impl Runner{
|
|||||||
init(&runner.lua)?;
|
init(&runner.lua)?;
|
||||||
Ok(runner)
|
Ok(runner)
|
||||||
}
|
}
|
||||||
pub fn run_script(&self,script:crate::script::Script,context:&mut Context)->Result<(),Error>{
|
pub fn run_script(&self,script:super::instance::Script,context:&mut Context)->Result<(),Error>{
|
||||||
let yoink=script.name_source(context);
|
let (name,source)=script.get_name_source(context).map_err(Error::Script)?;
|
||||||
|
self.lua.globals().set("script",script).map_err(|error|Error::Lua{source:source.clone(),error})?;
|
||||||
//this makes set_app_data shut up about the lifetime
|
//this makes set_app_data shut up about the lifetime
|
||||||
self.lua.set_app_data::<&'static mut rbx_dom_weak::WeakDom>(unsafe{core::mem::transmute(&mut context.dom)});
|
self.lua.set_app_data::<&'static mut rbx_dom_weak::WeakDom>(unsafe{core::mem::transmute(&mut context.dom)});
|
||||||
let (name,source)=yoink.map_err(Error::Script)?;
|
let r=self.lua.load(source.as_str())
|
||||||
self.lua.globals().set("script",super::instance::Instance::from(script)).map_err(Error::Lua)?;
|
|
||||||
self.lua.load(source)
|
|
||||||
.set_name(name)
|
.set_name(name)
|
||||||
.exec().map_err(Error::Lua)?;
|
.exec().map_err(|error|Error::Lua{source,error});
|
||||||
self.lua.remove_app_data::<&'static mut rbx_dom_weak::WeakDom>();
|
self.lua.remove_app_data::<&'static mut rbx_dom_weak::WeakDom>();
|
||||||
|
r?;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,37 +0,0 @@
|
|||||||
use rbx_dom_weak::types::Ref;
|
|
||||||
|
|
||||||
use crate::context::Context;
|
|
||||||
|
|
||||||
#[derive(Debug)]
|
|
||||||
pub enum Error{
|
|
||||||
NoScript,
|
|
||||||
NoSource,
|
|
||||||
}
|
|
||||||
|
|
||||||
fn get_full_name(dom:&rbx_dom_weak::WeakDom,instance:&rbx_dom_weak::Instance)->String{
|
|
||||||
let mut full_name=instance.name.clone();
|
|
||||||
let mut pref=instance.parent();
|
|
||||||
while let Some(parent)=dom.get_by_ref(pref){
|
|
||||||
full_name.insert(0,'.');
|
|
||||||
full_name.insert_str(0,parent.name.as_str());
|
|
||||||
pref=parent.parent();
|
|
||||||
}
|
|
||||||
full_name
|
|
||||||
}
|
|
||||||
|
|
||||||
pub struct Script{
|
|
||||||
pub(crate)script:Ref,
|
|
||||||
}
|
|
||||||
impl Script{
|
|
||||||
pub const fn new(script:Ref)->Self{
|
|
||||||
Self{script}
|
|
||||||
}
|
|
||||||
pub fn name_source(&self,context:&Context)->Result<(String,String),Error>{
|
|
||||||
let instance=context.dom.get_by_ref(self.script).ok_or(Error::NoScript)?;
|
|
||||||
let source=match instance.properties.get("Source").ok_or(Error::NoSource)?{
|
|
||||||
rbx_dom_weak::types::Variant::String(s)=>s.clone(),
|
|
||||||
_=>Err(Error::NoSource)?,
|
|
||||||
};
|
|
||||||
Ok((get_full_name(&context.dom,instance),source))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user