feat: add managed types, source classes and scoped native calls

This commit is contained in:
2026-10-21 01:47:08 +08:00
parent 7c842789c0
commit a970fd7707
48 changed files with 2069 additions and 134 deletions
+6 -4
View File
@@ -26,9 +26,11 @@ pub trait Spanned {
impl Program {
/// Iterate the currently supported top-level function declarations.
pub fn functions(&self) -> impl Iterator<Item = &Function> {
self.declarations.iter().map(|declaration| {
let DeclKind::Function(function) = &declaration.kind;
function
})
self.declarations
.iter()
.filter_map(|declaration| match &declaration.kind {
DeclKind::Function(function) => Some(function),
DeclKind::Class(_) => None,
})
}
}