Skip to content

Commit

Permalink
Identifiers are now allowed to have numbers in them.
Browse files Browse the repository at this point in the history
As long as they start with a letter.
  • Loading branch information
BenediktMagnus committed Mar 7, 2024
1 parent 4162fe3 commit 682d20c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lexer/lexer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export class Lexer
this.column = 1;

this.numberTestRegex = /\d/;
this.identifierTestRegex = /[a-zA-Z]/; // TODO: Replace with /[a-zA-Z]+\w*|_\w*[a-zA-Z0-9]+_*/
this.identifierTestRegex = /[a-zA-Z]+[a-zA-Z0-9]*/; // TODO: Replace with /[a-zA-Z]+\w*|_\w*[a-zA-Z0-9]+_*/
}

private getNextChar (): string
Expand Down

0 comments on commit 682d20c

Please sign in to comment.