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
Kirill Smelkov
cython
Commits
9f9b8b4c
Commit
9f9b8b4c
authored
Mar 23, 2008
by
Gary Furnish
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Circular cdef's
parent
4c48e8d4
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
221 additions
and
49 deletions
+221
-49
Cython/Compiler/Code.py
Cython/Compiler/Code.py
+3
-1
Cython/Compiler/Main.py
Cython/Compiler/Main.py
+1
-0
Cython/Compiler/ModuleNode.py
Cython/Compiler/ModuleNode.py
+206
-42
Cython/Compiler/Naming.py
Cython/Compiler/Naming.py
+5
-0
Cython/Compiler/Nodes.py
Cython/Compiler/Nodes.py
+6
-6
No files found.
Cython/Compiler/Code.py
View file @
9f9b8b4c
...
...
@@ -329,12 +329,14 @@ class CCodeWriter:
def
error_goto
(
self
,
pos
):
lbl
=
self
.
error_label
self
.
use_label
(
lbl
)
return
"{%s = %s[%s]; %s = %s; goto %s;}"
%
(
return
"{%s = %s[%s]; %s = %s;
%s = %s;
goto %s;}"
%
(
Naming
.
filename_cname
,
Naming
.
filetable_cname
,
self
.
lookup_filename
(
pos
[
0
]),
Naming
.
lineno_cname
,
pos
[
1
],
Naming
.
clineno_cname
,
Naming
.
line_c_macro
,
lbl
)
def
error_goto_if
(
self
,
cond
,
pos
):
...
...
Cython/Compiler/Main.py
View file @
9f9b8b4c
...
...
@@ -310,6 +310,7 @@ def compile(source, options = None, c_compile = 0, c_link = 0,
#------------------------------------------------------------------------
def main(command_line = 0):
args = sys.argv[1:]
any_failures = 0
if command_line:
...
...
Cython/Compiler/ModuleNode.py
View file @
9f9b8b4c
This diff is collapsed.
Click to expand it.
Cython/Compiler/Naming.py
View file @
9f9b8b4c
...
...
@@ -48,6 +48,8 @@ fileinit_cname = pyrex_prefix + "init_filenames"
intern_tab_cname
=
pyrex_prefix
+
"intern_tab"
kwds_cname
=
pyrex_prefix
+
"kwds"
lineno_cname
=
pyrex_prefix
+
"lineno"
clineno_cname
=
pyrex_prefix
+
"clineno"
cfilenm_cname
=
pyrex_prefix
+
"cfilenm"
module_cname
=
pyrex_prefix
+
"m"
moddoc_cname
=
pyrex_prefix
+
"mdoc"
methtable_cname
=
pyrex_prefix
+
"methods"
...
...
@@ -64,6 +66,9 @@ cleanup_cname = pyrex_prefix + "module_cleanup"
optional_args_cname
=
pyrex_prefix
+
"optional_args"
no_opt_args
=
pyrex_prefix
+
"no_opt_args"
line_c_macro
=
"__LINE__"
file_c_macro
=
"__FILE__"
extern_c_macro
=
pyrex_prefix
.
upper
()
+
"EXTERN_C"
...
...
Cython/Compiler/Nodes.py
View file @
9f9b8b4c
...
...
@@ -885,8 +885,8 @@ class FuncDefNode(StatNode, BlockNode):
exc_check
=
self
.
caller_will_check_exceptions
()
if
err_val
is
not
None
or
exc_check
:
code
.
putln
(
'__Pyx_AddTraceback("%s");'
%
self
.
entry
.
qualified_name
)
'__Pyx_AddTraceback("%s"
,%s,%s
);'
%
(
self
.
entry
.
qualified_name
,
Naming
.
cfilenm_cname
,
Naming
.
clineno_cname
)
)
if
err_val
is
not
None
:
code
.
putln
(
"%s = %s;"
%
(
...
...
@@ -3277,7 +3277,7 @@ class ExceptClauseNode(Node):
code
.
putln
(
"/*except:*/ {"
)
code
.
putln
(
'__Pyx_AddTraceback("%s"
);'
%
(
self
.
function_
name
))
'__Pyx_AddTraceback("%s"
,%s,%s);'
%
(
self
.
function_name
,
Naming
.
cfilenm_cname
,
Naming
.
clineno_c
name
))
# We always have to fetch the exception value even if
# there is no target, because this also normalises the
# exception and stores it in the thread state.
...
...
@@ -4095,13 +4095,13 @@ static void __Pyx_WriteUnraisable(char *name) {
traceback_utility_code
=
[
"""
static void __Pyx_AddTraceback(char *funcname); /*proto*/
static void __Pyx_AddTraceback(char *funcname
, char* cfilename, unsigned int cfileline
); /*proto*/
"""
,
"""
#include "compile.h"
#include "frameobject.h"
#include "traceback.h"
static void __Pyx_AddTraceback(char *funcname) {
static void __Pyx_AddTraceback(char *funcname
, char* cfilename, unsigned int cfileline
) {
PyObject *py_srcfile = 0;
PyObject *py_funcname = 0;
PyObject *py_globals = 0;
...
...
@@ -4111,7 +4111,7 @@ static void __Pyx_AddTraceback(char *funcname) {
py_srcfile = PyString_FromString(%(FILENAME)s);
if (!py_srcfile) goto bad;
py_funcname = PyString_From
String(funcnam
e);
py_funcname = PyString_From
Format( "%%s, %%s, %%u", funcname, cfilename, cfilelin
e);
if (!py_funcname) goto bad;
py_globals = PyModule_GetDict(%(GLOBALS)s);
if (!py_globals) goto bad;
...
...
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