Added a function to the Tokenizer to return a string of the tokens.
This commit is contained in:
@@ -114,3 +114,10 @@ def print_token_list(tokens):
|
||||
for tk in tokens:
|
||||
print("%s " %(tk.value), end = "")#, token.TokenType.get_token_type_name(tk.type)), end = "")
|
||||
print()
|
||||
|
||||
def stringify_token_list(tokens):
|
||||
text = ''
|
||||
for tk in tokens:
|
||||
text += str(tk.value)
|
||||
text += '\n'
|
||||
return text
|
||||
|
||||
Reference in New Issue
Block a user