Spaces:
Sleeping
Sleeping
Update parser.py
Browse files
parser.py
CHANGED
@@ -62,7 +62,7 @@ class Parser:
|
|
62 |
token_type, token_value = self.current()
|
63 |
if token_type == "IDENTIFIER":
|
64 |
return {"type": "var", "value": self.match("IDENTIFIER")[1]}
|
65 |
-
elif token_type
|
66 |
-
return {"type": "num", "value": self.match(
|
67 |
else:
|
68 |
-
raise SyntaxError(f"Expresi贸n inv谩lida: {self.current()}")
|
|
|
62 |
token_type, token_value = self.current()
|
63 |
if token_type == "IDENTIFIER":
|
64 |
return {"type": "var", "value": self.match("IDENTIFIER")[1]}
|
65 |
+
elif token_type in ("INT", "FLOAT"):
|
66 |
+
return {"type": "num", "value": self.match(token_type)[1]}
|
67 |
else:
|
68 |
+
raise SyntaxError(f"Expresi贸n inv谩lida: {self.current()}")
|