diff --git a/doc/console.png b/doc/console.png index ab35906..4af565c 100644 Binary files a/doc/console.png and b/doc/console.png differ diff --git a/examples/resource.rs b/examples/resource.rs index 8c32478..3e13b64 100644 --- a/examples/resource.rs +++ b/examples/resource.rs @@ -12,7 +12,7 @@ enum MyEnum { Numero1, Structio { a: f64, - b: f64, + b: String, }, Tupleo(String, f64), } diff --git a/src/builtin_parser/runner.rs b/src/builtin_parser/runner.rs index f5b4e3a..6be64b7 100644 --- a/src/builtin_parser/runner.rs +++ b/src/builtin_parser/runner.rs @@ -37,13 +37,13 @@ pub use value::Value; macro_rules! todo_error { () => { Err(RunError::Custom { - text: "This error message is not yet implemented.".into(), + text: concat!("todo error invoked at ", file!(), ":", line!(), ":", column!()).into(), span: 0..0 })? }; ($($arg:tt)+) => { Err(RunError::Custom { - text: format!("This error message is not yet implemented: {}", format_args!($($arg)+)).into(), + text: format!(concat!("todo error invoked at ", file!(), ":", line!(), ":", column!(), " : {}"), format_args!($($arg)+)).into(), span: 0..0 })? }; @@ -526,9 +526,18 @@ fn eval_path( )?; match left.value { - Path::Variable(variable) => { - todo_error!() - } + Path::Variable(variable) => match &*variable.upgrade().unwrap().borrow() { + Value::Resource(resource) => { + let mut resource = resource.clone(); + + resource.path.push('.'); + resource.path += &right; + + Ok(left.span.wrap(Path::Resource(resource))) + } + Value::Object(object) => todo_error!("todo object indexing"), + value => todo_error!("{value:?}"), + }, Path::Resource(mut resource) => { resource.path.push('.'); resource.path += &right; diff --git a/src/builtin_parser/runner/reflection.rs b/src/builtin_parser/runner/reflection.rs index 1935edd..587c644 100644 --- a/src/builtin_parser/runner/reflection.rs +++ b/src/builtin_parser/runner/reflection.rs @@ -7,7 +7,7 @@ use bevy::{ use super::Value; -#[derive(Debug)] +#[derive(Debug, Clone)] pub struct IntoResource { pub id: TypeId, pub path: String,