mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-02 08:11:12 +00:00
Add IdentIds::exposed_values
This commit is contained in:
parent
0f89d3558a
commit
5ca1494df1
3 changed files with 21 additions and 29 deletions
|
@ -1,4 +1,4 @@
|
|||
use crate::ident::{Ident, ModuleName};
|
||||
use crate::ident::{Ident, Lowercase, ModuleName};
|
||||
use crate::module_err::{IdentIdNotFoundSnafu, ModuleIdNotFoundSnafu, ModuleResult};
|
||||
use roc_collections::{SmallStringInterner, VecMap};
|
||||
use roc_error_macros::internal_error;
|
||||
|
@ -773,6 +773,13 @@ impl IdentIds {
|
|||
pub fn is_empty(&self) -> bool {
|
||||
self.interner.is_empty()
|
||||
}
|
||||
|
||||
pub fn exposed_values(&self) -> Vec<Lowercase> {
|
||||
self.ident_strs()
|
||||
.filter(|(_, ident)| ident.starts_with(|c: char| c.is_lowercase()))
|
||||
.map(|(_, ident)| Lowercase::from(ident))
|
||||
.collect()
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Default, Clone)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue