diff --git a/blueprintcompiler/formatter.py b/blueprintcompiler/formatter.py index eb2a485..b024d93 100644 --- a/blueprintcompiler/formatter.py +++ b/blueprintcompiler/formatter.py @@ -67,7 +67,10 @@ class Format: tokenized_str += item_as_string - if item_as_string in NEWLINE_AFTER: + if ( + item_as_string in NEWLINE_AFTER + or item.type == tokenizer.TokenType.COMMENT + ): tokenized_str += "\n" + (indent_levels * " ") elif item_as_string in WHITESPACE_AFTER: tokenized_str += " "