grammar: Make UseTree less ultra-janky

This commit is contained in:
2024-04-21 18:57:46 -05:00
parent 5341631781
commit e36a684422
7 changed files with 69 additions and 47 deletions

View File

@@ -228,15 +228,17 @@ pub enum ImplKind {
/// An import of nonlocal [Item]s
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
pub struct Use {
pub absolute: bool,
pub tree: UseTree,
}
/// A tree of [Item] imports
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
pub enum UseTree {
Tree(Path, Vec<UseTree>),
Alias(Path, Identifier),
Path(Path),
Tree(Vec<UseTree>),
Path(PathPart, Box<UseTree>),
Alias(Identifier, Identifier),
Name(Identifier),
Glob,
}