miden_assembly_syntax/ast/item/
mod.rs1mod index;
2mod items;
3mod resolver;
4
5use miden_debug_types::Spanned;
6
7pub use self::{
8 index::{GlobalItemIndex, ItemIndex, ModuleIndex},
9 items::Item,
10 resolver::{
11 LocalSymbol, LocalSymbolResolver, SymbolResolution, SymbolResolutionError, SymbolTable,
12 },
13};
14use super::{Ident, Import, Visibility};
15
16#[derive(Debug, Copy, Clone)]
17pub enum Declaration<'a> {
18 Item(&'a Item),
19 Import(&'a Import),
20 Submodule(&'a SubmoduleDecl),
21}
22
23impl Spanned for Declaration<'_> {
24 fn span(&self) -> miden_debug_types::SourceSpan {
25 match self {
26 Self::Item(item) => item.span(),
27 Self::Import(import) => import.local_name().span(),
28 Self::Submodule(decl) => decl.name.span(),
29 }
30 }
31}
32
33#[derive(Debug, Clone, PartialEq, Eq)]
35pub struct SubmoduleDecl {
36 pub visibility: Visibility,
45 pub name: Ident,
49}