mirror of
https://gitlab.gnome.org/jwestman/blueprint-compiler.git
synced 2025-05-04 15:59:08 -04:00
Formatter: Make tests pass
This commit is contained in:
parent
ad1ea4f51f
commit
be133eaab2
1 changed files with 6 additions and 9 deletions
|
@ -140,8 +140,8 @@ class Format:
|
||||||
another_newline(True)
|
another_newline(True)
|
||||||
commit_current_line(
|
commit_current_line(
|
||||||
LineType.BLOCK_OPEN,
|
LineType.BLOCK_OPEN,
|
||||||
# newlines=2 if prev_line_type in [LineType.CHILD_TYPE, LineType.COMMENT]
|
newlines=2 if prev_line_type in [LineType.CHILD_TYPE, LineType.COMMENT]
|
||||||
# or prev_line_type == LineType.BLOCK_OPEN else 1
|
or prev_line_type == LineType.BLOCK_OPEN else 1
|
||||||
)
|
)
|
||||||
|
|
||||||
elif str_item == "]" and is_child_type:
|
elif str_item == "]" and is_child_type:
|
||||||
|
@ -171,10 +171,7 @@ class Format:
|
||||||
else:
|
else:
|
||||||
newlines = 1
|
newlines = 1
|
||||||
|
|
||||||
commit_current_line(
|
commit_current_line(indent_decrease=True, newlines=newlines)
|
||||||
indent_decrease=True,
|
|
||||||
newlines=newlines
|
|
||||||
)
|
|
||||||
|
|
||||||
elif item.type == TokenType.COMMENT:
|
elif item.type == TokenType.COMMENT:
|
||||||
commit_current_line(LineType.COMMENT)
|
commit_current_line(LineType.COMMENT)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue