ITS GENERATING AN EXECUTABLE LETS GOOOO

This commit is contained in:
SpookyDervish
2025-09-01 18:00:49 +10:00
parent 62e95a24ed
commit 88cdcfa54f
7 changed files with 91 additions and 16 deletions

View File

@@ -19,7 +19,8 @@ class TokenType(Enum):
COMMENT = 11 # example: # hi there
LINE_REFERENCE = 12 # example: %12
LABEL_REFERENCE = 13 # example: %myLabel
EOF = 14
BOOL = 14 # example: true
EOF = 15
@dataclass
class Token:
@@ -397,6 +398,11 @@ def tokenize(input_string: str):
TokenType.INSTRUCTION,
value=current_token
))
elif current_token in ["true", "false"]:
tokens.append(Token(
TokenType.BOOL,
value=current_token == "true"
))
else:
traceback(input_string, "SyntaxError", f"\"{current_token}\" isn't a valid instruction.", line, start_col, column)