From 97c0db884537e20f97a99296c563394f51c6e077 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Bo=C4=8Fa?= Date: Sat, 6 Jan 2024 18:52:49 +0100 Subject: [PATCH] feat(identifier): Allowed _ in identifiers for better code readability --- src/lexer/lexer.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lexer/lexer.ts b/src/lexer/lexer.ts index e988347..d61d028 100644 --- a/src/lexer/lexer.ts +++ b/src/lexer/lexer.ts @@ -116,7 +116,7 @@ export class Lexer { if (this.isAlpha()) { let identifier = ""; - while (this.hasNext() && this.isAlpha()) { + while (this.hasNext() && (this.isAlpha() || this.getNext().value === "_")) { identifier += this.next().value; }