mirror of
https://github.com/slint-ui/slint.git
synced 2025-08-04 18:58:36 +00:00
parser: don't parse error on empty import statement
Report the error later when loading the import. That way, we get a more complete AST for auto-completion
This commit is contained in:
parent
7d3968f025
commit
40922874fa
5 changed files with 11 additions and 10 deletions
|
@ -252,15 +252,15 @@ fn parse_import_specifier(p: &mut impl Parser) -> bool {
|
|||
/// { Type1 }
|
||||
/// { Type2, Type3 }
|
||||
/// { Type as Alias1, Type as AnotherAlias }
|
||||
/// {}
|
||||
/// ```
|
||||
fn parse_import_identifier_list(p: &mut impl Parser) -> bool {
|
||||
let mut p = p.start_node(SyntaxKind::ImportIdentifierList);
|
||||
if !p.expect(SyntaxKind::LBrace) {
|
||||
return false;
|
||||
}
|
||||
if p.peek().kind == SyntaxKind::RBrace {
|
||||
p.error("Import names are missing. Please specify which types you would like to import");
|
||||
return false;
|
||||
if p.test(SyntaxKind::RBrace) {
|
||||
return true;
|
||||
}
|
||||
loop {
|
||||
parse_import_identifier(&mut *p);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue