mirror of
https://gitlab.gnome.org/jwestman/blueprint-compiler.git
synced 2025-05-04 15:59:08 -04:00
Formatter: Distinguish child types and lists
This commit is contained in:
parent
01f67c3f47
commit
8c4eebba08
1 changed files with 3 additions and 5 deletions
|
@ -45,11 +45,9 @@ class Format:
|
|||
if item_as_string in OPENING_TOKENS:
|
||||
split_string = tokenized_str.splitlines()
|
||||
|
||||
index = -1
|
||||
if "[" in split_string[-2] and "]" in split_string[-2]:
|
||||
index = -2
|
||||
|
||||
split_string.insert(index, "")
|
||||
split_string.insert(
|
||||
-2 if split_string[-2].strip().startswith("[") else -1, ""
|
||||
)
|
||||
tokenized_str = "\n".join(split_string)
|
||||
|
||||
indent_levels += 1
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue