feat: add managed types, source classes and scoped native calls
This commit is contained in:
@@ -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,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user