Skip to content

Commit

Permalink
fix: bug in discardUntil causes the first invalid token to be missed
Browse files Browse the repository at this point in the history
  • Loading branch information
Huy-DNA committed Aug 16, 2023
1 parent 54a35cb commit dd19fe6
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions packages/dbml-core/src/parse/dbml/src/lib/parser/parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ export default class Parser {
// If any tokens are discarded, the error message is logged
private discardUntil(message: string, ...kind: SyntaxTokenKind[]): boolean {
if (!this.check(...kind)) {
this.invalid.push(this.peek());
this.logError(this.advance(), CompileErrorCode.UNEXPECTED_TOKEN, message);
while (!this.isAtEnd() && !this.check(...kind)) {
this.invalid.push(this.advance());
Expand Down

0 comments on commit dd19fe6

Please sign in to comment.