ITS GENERATING AN EXECUTABLE LETS GOOOO
This commit is contained in:
@@ -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)
|
||||
|
||||
|
Reference in New Issue
Block a user