Enquanto que fazendo as chamadas:
>>> t1 = Token("+",OPERADOR) >>> str(t1) "O('+')" >>> print(t1) O('+')
sai tudo direitinho, ao fazer
>>> lista = tokeniza("+") >>> imprima_tokens(lista)
tenho como resposta
Traceback (most recent call last):
File "<pyshell#72>", line 1, in <module>
print(lista[0])
File "C:\Users\matheus.cunha.CEC\Desktop\esqueleto_tokeniza.py", line 211, in __str__
return texto
UnboundLocalError: local variable 'texto' referenced before assignment
("texto" é o nome da variável que recebe as strings no método __str__ )
Algum help, please?