Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Gwenaël Samain
cython
Commits
c52473c5
Commit
c52473c5
authored
Jul 29, 2008
by
Dag Sverre Seljebotn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Used dedent to clean up buffer code generation
parent
f78e4cb8
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
144 additions
and
125 deletions
+144
-125
Cython/Compiler/Buffer.py
Cython/Compiler/Buffer.py
+143
-125
Cython/Compiler/TreeFragment.py
Cython/Compiler/TreeFragment.py
+1
-0
No files found.
Cython/Compiler/Buffer.py
View file @
c52473c5
This diff is collapsed.
Click to expand it.
Cython/Compiler/TreeFragment.py
View file @
c52473c5
...
...
@@ -164,6 +164,7 @@ def copy_code_tree(node):
INDENT_RE
=
re
.
compile
(
ur"^ *"
)
def
strip_common_indent
(
lines
):
"Strips empty lines and common indentation from the list of strings given in lines"
# TODO: Facilitate textwrap.indent instead
lines
=
[
x
for
x
in
lines
if
x
.
strip
()
!=
u""
]
minindent
=
min
([
len
(
INDENT_RE
.
match
(
x
).
group
(
0
))
for
x
in
lines
])
lines
=
[
x
[
minindent
:]
for
x
in
lines
]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment