forked from M-Labs/nac3
composer: handle external subkernels
This commit is contained in:
parent
b0cb74423d
commit
26059208ff
@ -2132,23 +2132,26 @@ impl TopLevelComposer {
|
||||
else {
|
||||
unreachable!()
|
||||
};
|
||||
// do this only if destination differs from current
|
||||
if let Some(dest) == /* also extract destination from the decorator ... */
|
||||
{
|
||||
instance_to_symbol.insert(String::new(), simple_name.to_string());
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if !decorator_list.is_empty()
|
||||
&& matches!(&decorator_list[0].node,
|
||||
ast::ExprKind::Name{ id, .. } if id == &"subkernel".into())
|
||||
{
|
||||
// do this only if destination differs from current
|
||||
if let Some(dest) == /* also extract destination from the decorator ... */
|
||||
if let ExprKind::Call { func, keywords, .. } = &decorator_list[0].node {
|
||||
if matches!(&func.node, ExprKind::Name { id, .. } if id == &"subkernel".into())
|
||||
{
|
||||
let subkernel_dest = keywords.iter().find(|keyword| {
|
||||
if keyword.node.arg == Some("destination".into()) {
|
||||
if let ExprKind::Constant { value, .. } = &keyword.node.value.node {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
false
|
||||
}
|
||||
).node.value.node.value;
|
||||
if let Some(Constant::Int(sk_dest)) == subkernel_dest {
|
||||
if sk_dest != destination.unwrap_or(0) {
|
||||
instance_to_symbol.insert(String::new(), simple_name.to_string());
|
||||
}
|
||||
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user