mirror of
https://github.com/slint-ui/slint.git
synced 2025-08-04 18:58:36 +00:00
compiler: Put the argument names in the Type
That simplifies things a bit and will allow to have names for builtin callback and functions
This commit is contained in:
parent
b6baa4a587
commit
f225f79d49
12 changed files with 116 additions and 183 deletions
|
@ -1172,10 +1172,22 @@ impl Element {
|
|||
.ReturnType()
|
||||
.map(|ret_ty| type_from_node(ret_ty.Type(), diag, tr))
|
||||
.unwrap_or(Type::Void);
|
||||
let arg_names = sig_decl
|
||||
.CallbackDeclarationParameter()
|
||||
.map(|a| {
|
||||
a.DeclaredIdentifier()
|
||||
.and_then(|x| parser::identifier_text(&x))
|
||||
.unwrap_or_default()
|
||||
})
|
||||
.collect();
|
||||
r.property_declarations.insert(
|
||||
name,
|
||||
PropertyDeclaration {
|
||||
property_type: Type::Callback(Rc::new(Function { return_type, args })),
|
||||
property_type: Type::Callback(Rc::new(Function {
|
||||
return_type,
|
||||
args,
|
||||
arg_names,
|
||||
})),
|
||||
node: Some(sig_decl.into()),
|
||||
visibility: PropertyVisibility::InOut,
|
||||
pure,
|
||||
|
@ -1256,7 +1268,11 @@ impl Element {
|
|||
r.property_declarations.insert(
|
||||
name,
|
||||
PropertyDeclaration {
|
||||
property_type: Type::Function(Rc::new(Function { return_type, args })),
|
||||
property_type: Type::Function(Rc::new(Function {
|
||||
return_type,
|
||||
args,
|
||||
arg_names,
|
||||
})),
|
||||
node: Some(func.into()),
|
||||
visibility,
|
||||
pure,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue