From e7c074245c21852dad5ce4eaa648acf640200e14 Mon Sep 17 00:00:00 2001 From: Alexandre B A Villares <3694604+villares@users.noreply.github.com> Date: Tue, 18 Jun 2024 12:12:13 -0300 Subject: [PATCH] Update tokenize_helper.py --- 2023/sketch_2023_08_14/tokenize_helper.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/2023/sketch_2023_08_14/tokenize_helper.py b/2023/sketch_2023_08_14/tokenize_helper.py index 909ef9ec..9c00310d 100644 --- a/2023/sketch_2023_08_14/tokenize_helper.py +++ b/2023/sketch_2023_08_14/tokenize_helper.py @@ -33,7 +33,11 @@ def get_tokens(text_lines): def reassemble_tokens(token_tuples, styles={}): """ Gets a list of "tokens tuples" from a tokenized text - and returns a list of "styled segments". + and returns text colored with ansi escape codes. + + The style dict maps tokenize's token-type constants + to STYLE dict keys from the parse_ansi_strings helper + that will in turn inform the ansi formatting to be added. """ lines = [] current_line = ""