diff options
author | Iván Ávalos <avalos@disroot.org> | 2022-11-06 23:46:09 -0600 |
---|---|---|
committer | Iván Ávalos <avalos@disroot.org> | 2022-11-06 23:46:09 -0600 |
commit | fba2ad7934997eb62156533c0788ce7abae64302 (patch) | |
tree | 7701d9a5ad31b042887756cb5e743a35a66b0fb7 | |
parent | 2e1f87b79d3ba990c501860715dfdb7c27f1948f (diff) | |
download | javanol-fba2ad7934997eb62156533c0788ce7abae64302.tar.gz javanol-fba2ad7934997eb62156533c0788ce7abae64302.tar.bz2 javanol-fba2ad7934997eb62156533c0788ce7abae64302.zip |
Se cubren literales booleanas
-rw-r--r-- | lexer.py | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -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 = '' |