feat: parser + AST (Phase 1)

This commit is contained in:
2026-05-30 21:19:43 +03:00
parent 1b708ec755
commit 713ab8e4d6
6 changed files with 1598 additions and 7 deletions
+3 -1
View File
@@ -142,7 +142,9 @@ proc scanIdent(lex: var Lexer, startLoc: SourceLocation): Token =
while not lex.isAtEnd() and isIdentChar(lex.peek()):
discard lex.advance()
let text = lex.source[startPos ..< lex.pos]
let kind = keywordKind(text)
var kind = keywordKind(text)
if text == "_":
kind = tkUnderscore
result = Token(kind: kind, text: text, loc: startLoc)
# ---------------------------------------------------------------------------