added variables

This commit is contained in:
2024-12-02 22:59:25 +01:00
parent 36744b9b3e
commit 21cd343eaa
4 changed files with 30 additions and 3 deletions
+11
View File
@@ -12,6 +12,17 @@ macro_rules! check_expr {
}
#[macro_export]
macro_rules! parse_rsx_param {
// Data fields
($elem:expr, @$name:ident: $type:ty; $($rest:tt)*) => {
if $elem.children.is_none() {$elem.children = $crate::Children::Children(Vec::new(), 0)}
if let $crate::Children::Children(children, _) = &mut $elem.children {
let mut $name = $crate::ui::data_holder::<$type>();
$name.id = stringify!($name);
children.push($name);
}
osui::parse_rsx_param!($elem, $($rest)*)
};
($elem:expr, for ($($for:tt)*) $code:block $($rest:tt)*) => {
if $elem.children.is_none() {$elem.children = $crate::Children::Children(Vec::new(), 0)}
if let $crate::Children::Children(children, _) = &mut $elem.children {