main: only print tokens if in debug mode

This commit is contained in:
Antoine Viallon 2023-05-08 23:10:45 +02:00
parent bd402beba7
commit 585910a60b
Signed by: aviallon
GPG key ID: D126B13AB555E16F

View file

@ -13,11 +13,13 @@ def main():
2 + 3 / (8 - 1 + 3) * 1
+ 34.2
"""
print("Source:\n", data)
tokenizer = Tokenizer()
tokens = tokenizer.tokenize(data)
tokens = [token for token in tokens if token.kind not in [Tokens.Blank, Tokens.Newline]]
pprint(tokens)
if rootLogger.level <= LogLevel.Debug:
pprint(tokens)
parser = Parser(tokens)
try: