mirror of
https://github.com/slint-ui/slint.git
synced 2025-08-04 10:50:00 +00:00
Fix support for multiple import statements from the same path (#1868)
Importing multiple types from the same file with multiple import statements would produce an error.
This commit is contained in:
parent
809255ea56
commit
59d3a69688
7 changed files with 63 additions and 35 deletions
|
@ -229,7 +229,6 @@ fn parse_import_specifier(p: &mut impl Parser) -> bool {
|
|||
/// ```test,ImportIdentifierList
|
||||
/// { Type1 }
|
||||
/// { Type2, Type3 }
|
||||
/// { }
|
||||
/// { Type as Alias1, Type as AnotherAlias }
|
||||
/// ```
|
||||
fn parse_import_identifier_list(p: &mut impl Parser) -> bool {
|
||||
|
@ -237,8 +236,9 @@ fn parse_import_identifier_list(p: &mut impl Parser) -> bool {
|
|||
if !p.expect(SyntaxKind::LBrace) {
|
||||
return false;
|
||||
}
|
||||
if p.test(SyntaxKind::RBrace) {
|
||||
return true;
|
||||
if p.peek().kind == SyntaxKind::RBrace {
|
||||
p.error("Import names are missing. Please specify which types you would like to import");
|
||||
return false;
|
||||
}
|
||||
loop {
|
||||
parse_import_identifier(&mut *p);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue