aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIván Ávalos <avalos@disroot.org>2022-11-06 23:46:09 -0600
committerIván Ávalos <avalos@disroot.org>2022-11-06 23:46:09 -0600
commitfba2ad7934997eb62156533c0788ce7abae64302 (patch)
tree7701d9a5ad31b042887756cb5e743a35a66b0fb7
parent2e1f87b79d3ba990c501860715dfdb7c27f1948f (diff)
downloadjavanol-fba2ad7934997eb62156533c0788ce7abae64302.tar.gz
javanol-fba2ad7934997eb62156533c0788ce7abae64302.tar.bz2
javanol-fba2ad7934997eb62156533c0788ce7abae64302.zip
Se cubren literales booleanas
-rw-r--r--lexer.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/lexer.py b/lexer.py
index 6aa734c..0c555c5 100644
--- a/lexer.py
+++ b/lexer.py
@@ -33,7 +33,7 @@ def inicio_lexer(data):
recol_operador = c
continue
elif (c == '{' or c == '}' or c == '(' or c == ')' or
- c == ',' or c == ';' or (c == '*' and recol_comentario == '')):
+ c == ',' or c == '.' or c == ';' or (c == '*' and recol_comentario == '')):
tabla.insertar(LexToken(c, None, None, 1))
continue
@@ -125,6 +125,10 @@ def inicio_lexer(data):
tabla.insertar(LexToken('VOID', None, None, 1))
elif recol_ident == 'mientras':
tabla.insertar(LexToken('WHILE', None, None, 1))
+ elif recol_ident == 'verdadero':
+ tabla.insertar(LexToken('BOOLEAN_LIT', None, True, 1))
+ elif recol_ident == 'falso':
+ tabla.insertar(LexToken('BOOLEAN_LIT', None, False, 1))
else:
tabla.insertar(LexToken('IDENT', recol_ident, None, 1))
recol_ident = ''