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
3bbefcb4
Commit
3bbefcb4
authored
Feb 14, 2009
by
Dag Sverre Seljebotn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleanup: Removed chained CodeWriter calls
parent
a7b92caa
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
30 deletions
+19
-30
Cython/Compiler/Code.py
Cython/Compiler/Code.py
+19
-30
No files found.
Cython/Compiler/Code.py
View file @
3bbefcb4
...
...
@@ -189,13 +189,12 @@ class GlobalState(object):
self
.
init_cached_builtins_writer
.
putln
(
"static int __Pyx_InitCachedBuiltins(void) {"
)
self
.
initwriter
.
enter_cfunc_scope
()
self
.
initwriter
.
putln
(
""
).
putln
(
"static int __Pyx_InitGlobals(void) {"
)
self
.
initwriter
.
putln
(
""
)
self
.
initwriter
.
putln
(
"static int __Pyx_InitGlobals(void) {"
)
(
self
.
pystring_table
.
putln
(
""
)
.
putln
(
"static __Pyx_StringTabEntry %s[] = {"
%
self
.
pystring_table
.
putln
(
""
)
self
.
pystring_table
.
putln
(
"static __Pyx_StringTabEntry %s[] = {"
%
Naming
.
stringtab_cname
)
)
#
# Global constants, interned objects, etc.
...
...
@@ -207,7 +206,8 @@ class GlobalState(object):
# This is called when it is known that no more global declarations will
# declared (but can be called before or after insert_XXX).
if
self
.
pystring_table_needed
:
self
.
pystring_table
.
putln
(
"{0, 0, 0, 0, 0, 0}"
).
putln
(
"};"
)
self
.
pystring_table
.
putln
(
"{0, 0, 0, 0, 0, 0}"
)
self
.
pystring_table
.
putln
(
"};"
)
import
Nodes
self
.
use_utility_code
(
Nodes
.
init_string_tab_utility_code
)
self
.
initwriter
.
putln
(
...
...
@@ -216,21 +216,19 @@ class GlobalState(object):
self
.
initwriter
.
error_goto
(
self
.
module_pos
)))
if
Options
.
cache_builtins
:
(
self
.
init_cached_builtins_writer
.
putln
(
"return 0;"
)
.
put_label
(
self
.
init_cached_builtins_writer
.
error_label
)
.
putln
(
"return -1;"
)
.
putln
(
"}"
)
.
exit_cfunc_scope
()
)
(
self
.
initwriter
.
putln
(
"return 0;"
)
.
put_label
(
self
.
initwriter
.
error_label
)
.
putln
(
"return -1;"
)
.
putln
(
"}"
)
.
exit_cfunc_scope
()
)
w
=
self
.
init_cached_builtins_writer
w
.
putln
(
"return 0;"
)
w
.
put_label
(
w
.
error_label
)
w
.
putln
(
"return -1;"
)
w
.
putln
(
"}"
)
w
.
exit_cfunc_scope
()
w
=
self
.
initwriter
w
.
putln
(
"return 0;"
)
w
.
put_label
(
w
.
error_label
)
w
.
putln
(
"return -1;"
)
w
.
putln
(
"}"
)
w
.
exit_cfunc_scope
()
def
insert_initcode_into
(
self
,
code
):
if
self
.
pystring_table_needed
:
...
...
@@ -525,7 +523,6 @@ class CCodeWriter(object):
self
.
put
(
code
)
self
.
write
(
"
\
n
"
);
self
.
bol
=
1
return
self
def
emit_marker
(
self
):
self
.
write
(
"
\
n
"
);
...
...
@@ -533,7 +530,6 @@ class CCodeWriter(object):
self
.
write
(
"/* %s */
\
n
"
%
self
.
marker
[
1
])
self
.
last_marker_line
=
self
.
marker
[
0
]
self
.
marker
=
None
return
self
def
put_safe
(
self
,
code
):
# put code, but ignore {}
...
...
@@ -556,25 +552,20 @@ class CCodeWriter(object):
self
.
level
+=
dl
elif
fix_indent
:
self
.
level
+=
1
return
self
def
increase_indent
(
self
):
self
.
level
=
self
.
level
+
1
return
self
def
decrease_indent
(
self
):
self
.
level
=
self
.
level
-
1
return
self
def
begin_block
(
self
):
self
.
putln
(
"{"
)
self
.
increase_indent
()
return
self
def
end_block
(
self
):
self
.
decrease_indent
()
self
.
putln
(
"}"
)
return
self
def
indent
(
self
):
self
.
write
(
" "
*
self
.
level
)
...
...
@@ -603,12 +594,10 @@ class CCodeWriter(object):
def
put_label
(
self
,
lbl
):
if
lbl
in
self
.
funcstate
.
labels_used
:
self
.
putln
(
"%s:;"
%
lbl
)
return
self
def
put_goto
(
self
,
lbl
):
self
.
funcstate
.
use_label
(
lbl
)
self
.
putln
(
"goto %s;"
%
lbl
)
return
self
def
put_var_declarations
(
self
,
entries
,
static
=
0
,
dll_linkage
=
None
,
definition
=
True
):
...
...
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