mirror of
https://github.com/slint-ui/slint.git
synced 2025-11-02 04:48:27 +00:00
Better error when using ';' instead of ',' when declaring struct
This commit is contained in:
parent
c1dce3e2a1
commit
37f11e566b
2 changed files with 19 additions and 0 deletions
|
|
@ -41,6 +41,11 @@ pub fn parse_type_object(p: &mut impl Parser) {
|
|||
p.expect(SyntaxKind::Identifier);
|
||||
p.expect(SyntaxKind::Colon);
|
||||
parse_type(&mut *p);
|
||||
if p.peek().kind() == SyntaxKind::Semicolon {
|
||||
p.error("Expected ','. Use ',' instead of ';' to separate fields in a struct");
|
||||
p.consume();
|
||||
continue;
|
||||
}
|
||||
if !p.test(SyntaxKind::Comma) {
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue