Skip to content

Commit

Permalink
fix: properly add invalid tokens when looking for :, { in elementDecl…
Browse files Browse the repository at this point in the history
…aration
  • Loading branch information
Huy-DNA committed Aug 5, 2023
1 parent 90213cb commit bcd0127
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions packages/dbml-core/src/parse/dbml/src/lib/parser/parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,12 +180,11 @@ export default class Parser {

if (!this.check(SyntaxTokenKind.COLON, SyntaxTokenKind.LBRACE)) {
const token = this.peek();
this.invalid.push(token);
this.errors.push(
this.generateTokenError(token, ParsingErrorCode.EXPECTED_THINGS, 'Expect { or :'),
);
while (!this.isAtEnd() && !this.check(SyntaxTokenKind.COLON, SyntaxTokenKind.LBRACE)) {
this.advance();
this.invalid.push(this.advance());
}
}

Expand Down

0 comments on commit bcd0127

Please sign in to comment.