From 8cd27f1219cf710c66e0d67664f31075d33d6c33 Mon Sep 17 00:00:00 2001 From: gregorni Date: Wed, 27 Sep 2023 17:27:50 +0200 Subject: [PATCH] formatter.py: Add TODO comments --- blueprintcompiler/formatter.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/blueprintcompiler/formatter.py b/blueprintcompiler/formatter.py index ae6660e..2836193 100644 --- a/blueprintcompiler/formatter.py +++ b/blueprintcompiler/formatter.py @@ -58,7 +58,7 @@ class Format: parentheses_balance = 0 bracket_tracker = [None] - def another_newline(one_indent_less=False): + def another_newline(one_indent_less=False): # TODO: Try to remove this function nonlocal end_str end_str = ( end_str.strip() @@ -75,6 +75,7 @@ class Format: nonlocal end_str, current_line, prev_line_type whitespace_to_add = ( + # TODO: Separate adding newlines before & after current_line ("\n" * newlines) + (indent_levels * indent_item) if newlines > 0 else "" @@ -132,7 +133,9 @@ class Format: prev_line_type in [LineType.CHILD_TYPE, LineType.COMMENT] or prev_line_type == LineType.BLOCK_OPEN ): - another_newline(True) + another_newline( + True + ) # TODO: Do this in the commit_current_line() below commit_current_line( LineType.BLOCK_OPEN, )