Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add first draft public API to navigate the design #228

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions vhdl_lang/src/analysis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ mod standard;
mod static_expression;
mod target;

// @TODO consider moving facade into analysis
pub(crate) use {lock::ReadGuard, root::AnalysisData};

#[cfg(test)]
pub(crate) mod tests;
pub(crate) use root::{Library, LockedUnit};
Expand Down
3 changes: 2 additions & 1 deletion vhdl_lang/src/analysis/root.rs
Original file line number Diff line number Diff line change
Expand Up @@ -261,10 +261,11 @@ impl Library {
})
}

// @TODO optimize O() complexity
pub(crate) fn secondary_units<'a>(
&'a self,
primary: &'a Symbol,
) -> impl Iterator<Item = &'a LockedUnit> {
) -> impl Iterator<Item = &'a LockedUnit> + 'a {
self.units.iter().filter_map(move |(key, value)| match key {
UnitKey::Secondary(sym, _) if primary == sym => Some(value),
_ => None,
Expand Down
Loading
Loading