mirror of
https://github.com/slint-ui/slint.git
synced 2025-09-30 22:01:13 +00:00
Lookup of identifier is now done while resolving expressions
This commit is contained in:
parent
e6bed90ced
commit
1de4eb476b
6 changed files with 116 additions and 57 deletions
|
@ -141,13 +141,11 @@ pub fn sixtyfps(stream: TokenStream) -> TokenStream {
|
|||
for (k, v) in &item.init_properties {
|
||||
let k = quote::format_ident!("{}", k);
|
||||
let v = match v {
|
||||
Expression::Invalid | Expression::Uncompiled(_) => quote!(),
|
||||
// That's an error
|
||||
Expression::Identifier(_) => quote!(),
|
||||
Expression::StringLiteral(s) => {
|
||||
quote!(sixtyfps::re_exports::SharedString::from(#s))
|
||||
}
|
||||
Expression::NumberLiteral(n) => quote!(#n),
|
||||
_ => quote!(compile_error! {"unsupported expression"}),
|
||||
};
|
||||
init.push(quote!(self_.#field_name.#k.set(#v as _);));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue