cl-interpret: process use items and imports in the interpreter

This commit is contained in:
2025-02-18 21:44:52 -06:00
parent af9c293907
commit edabbe1655
6 changed files with 78 additions and 10 deletions

View File

@@ -681,7 +681,11 @@ impl Parse<'_> for UseTree {
let PathPart::Ident(name) = name else {
Err(p.error(ErrorKind::ExpectedParsing { want: Parsing::Identifier }, P))?
};
UseTree::Name(name)
if p.match_type(TokenKind::As, P).is_ok() {
UseTree::Alias(name, p.parse()?)
} else {
UseTree::Name(name)
}
}
}
t => Err(p.error(Unexpected(t), Parsing::UseTree))?,