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:
|
if item_as_string in OPENING_TOKENS:
|
||||||
split_string = tokenized_str.splitlines()
|
split_string = tokenized_str.splitlines()
|
||||||
|
|
||||||
index = -1
|
split_string.insert(
|
||||||
if "[" in split_string[-2] and "]" in split_string[-2]:
|
-2 if split_string[-2].strip().startswith("[") else -1, ""
|
||||||
index = -2
|
)
|
||||||
|
|
||||||
split_string.insert(index, "")
|
|
||||||
tokenized_str = "\n".join(split_string)
|
tokenized_str = "\n".join(split_string)
|
||||||
|
|
||||||
indent_levels += 1
|
indent_levels += 1
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue