We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ef1dd89 commit 4d2caffCopy full SHA for 4d2caff
1 file changed
tools/reduce.py
@@ -178,15 +178,17 @@ def removeblocks(filedata):
178
179
i2 = i1
180
indent = 0
181
- while i2 < len(filedata):
+ while i2 < len(filedata) and indent>=0:
182
for c in filedata[i2]:
183
if c == '}':
184
indent = indent - 1
185
- if indent <= 0:
186
- break
+ if indent == 0:
+ indent = -100
187
elif c == '{':
188
indent = indent + 1
189
i2 = i2 + 1
190
+ if indent == -100:
191
+ indent = 0
192
if i2 == i1 or i2 >= len(filedata):
193
continue
194
if filedata[i2].strip() != '}' and filedata[i2].strip() != '};':
0 commit comments