projects
/
cython.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e42ddaa
)
fix code writer indentation correct for '} else {'
author
Stefan Behnel
<scoder@users.berlios.de>
Fri, 11 Jul 2008 12:32:07 +0000
(14:32 +0200)
committer
Stefan Behnel
<scoder@users.berlios.de>
Fri, 11 Jul 2008 12:32:07 +0000
(14:32 +0200)
Cython/Compiler/Code.py
patch
|
blob
|
history
diff --git
a/Cython/Compiler/Code.py
b/Cython/Compiler/Code.py
index afba02f8c3ba767d5501c7d4b216fa3d519ce254..ce615cf1b1a583f338e11d62d9b31d7ff79fae45 100644
(file)
--- a/
Cython/Compiler/Code.py
+++ b/
Cython/Compiler/Code.py
@@
-64,13
+64,17
@@
class CCodeWriter:
dl = code.count("{") - code.count("}")
if dl < 0:
self.level += dl
+ elif dl == 0 and code.startswith('}'):
+ self.level -= 1
if self.bol:
self.indent()
self._write(code)
self.bol = 0
if dl > 0:
self.level += dl
-
+ elif dl == 0 and code.startswith('}'):
+ self.level += 1
+
def increase_indent(self):
self.level = self.level + 1