feat: Implement single-line comments

This commit is contained in:
Alvin
2025-07-22 16:57:24 +02:00
parent 7ef8f820b4
commit 3461ed8863
2 changed files with 12 additions and 0 deletions

View File

@@ -29,6 +29,12 @@ class Lexer:
current_char = self.text[self.pos]
# Handle comments
if current_char == '#':
while self.pos < len(self.text) and self.text[self.pos] != '\n':
self.pos += 1
return self.get_next_token() # Recursively call to get the next actual token
if current_char == '"':
self.pos += 1
string_start = self.pos