From fba2ad7934997eb62156533c0788ce7abae64302 Mon Sep 17 00:00:00 2001 From: Iván Ávalos Date: Sun, 6 Nov 2022 23:46:09 -0600 Subject: Se cubren literales booleanas --- lexer.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 = '' -- cgit v1.2.3