use std::collections::HashSet;
use harn_lexer::Span;
pub(crate) struct Declaration {
pub(crate) name: String,
pub(crate) span: Span,
pub(crate) is_mutable: bool,
pub(crate) is_simple_ident: bool,
}
pub(crate) struct ImportInfo {
pub(crate) names: Vec<String>,
pub(crate) invalid_names: HashSet<String>,
pub(crate) span: Span,
pub(crate) is_pub: bool,
}
impl ImportInfo {
pub(crate) fn is_unused(
&self,
name: &str,
value_references: &HashSet<String>,
type_references: &HashSet<String>,
) -> bool {
!self.invalid_names.contains(name)
&& !value_references.contains(name)
&& !type_references.contains(name)
}
}
pub(crate) struct ParamDeclaration {
pub(crate) name: String,
pub(crate) span: Span,
}
pub(crate) struct FnDeclaration {
pub(crate) name: String,
pub(crate) span: Span,
pub(crate) is_pub: bool,
pub(crate) is_method: bool,
}
pub(crate) struct TypeDeclaration {
pub(crate) name: String,
pub(crate) span: Span,
pub(crate) kind: &'static str,
pub(crate) is_pub: bool,
}