Skip to content

Commit

Permalink
Omit the extra newline when a bodyless for-loop is present (angr#4048)
Browse files Browse the repository at this point in the history
* Omit the extra newline when a bodyless for-loop is present

* LMAO, i forgot to unindent
  • Loading branch information
mahaloz authored Jul 29, 2023
1 parent 40783d5 commit dc20462
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions angr/analyses/decompiler/structured_codegen/c.py
Original file line number Diff line number Diff line change
Expand Up @@ -829,12 +829,13 @@ def c_repr_chunks(self, indent=0, asexpr=False):
yield from self.iterator.c_repr_chunks(indent=0, asexpr=True)
yield ")", paren

if self.codegen.braces_on_own_lines:
yield "\n", None
yield indent_str, None
else:
yield " ", None
if self.body is not None:
if self.codegen.braces_on_own_lines:
yield "\n", None
yield indent_str, None
else:
yield " ", None

yield "{", brace
yield "\n", None
yield from self.body.c_repr_chunks(indent=indent + INDENT_DELTA)
Expand Down

0 comments on commit dc20462

Please sign in to comment.