feat: a lot

This commit is contained in:
2025-08-06 18:30:19 +08:00
parent 32c602f21c
commit f946cb2fd1
22 changed files with 735 additions and 591 deletions

View File

@@ -125,13 +125,13 @@ pub fn downgrade_inherit(
));
}
};
let expr = from.map_or_else(
let expr = from.as_ref().map_or_else(
// If `from` is None, `inherit foo;` becomes `foo = foo;`.
|| Var { sym: ident.clone() }.to_hir(),
// If `from` is Some, `inherit (from) foo;` becomes `foo = from.foo;`.
|expr| {
Select {
expr,
expr: unsafe { expr.clone() },
attrpath: vec![Attr::Str(ident.clone())],
default: None,
}