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
bddf62c2
Commit
bddf62c2
authored
May 27, 2008
by
Dag Sverre Seljebotn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed str conversion from SourceDescriptors in order to be more explicit.
parent
fcccb15f
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
6 deletions
+13
-6
Cython/Compiler/Code.py
Cython/Compiler/Code.py
+1
-1
Cython/Compiler/Errors.py
Cython/Compiler/Errors.py
+1
-1
Cython/Compiler/ModuleNode.py
Cython/Compiler/ModuleNode.py
+1
-1
Cython/Compiler/Scanning.py
Cython/Compiler/Scanning.py
+10
-3
No files found.
Cython/Compiler/Code.py
View file @
bddf62c2
...
...
@@ -114,7 +114,7 @@ class CCodeWriter:
s
=
s
.
rstrip
()
+
' # <<<<<<<<<<<<<< '
+
'
\
n
'
context
+=
" * "
+
s
marker
=
'"%s":%d
\
n
%s'
%
(
s
tr
(
source_desc
).
encode
(
'ASCII'
,
'replace'
),
line
,
context
)
marker
=
'"%s":%d
\
n
%s'
%
(
s
ource_desc
.
get_description
(
).
encode
(
'ASCII'
,
'replace'
),
line
,
context
)
if
self
.
last_marker
!=
marker
:
self
.
marker
=
marker
...
...
Cython/Compiler/Errors.py
View file @
bddf62c2
...
...
@@ -29,7 +29,7 @@ class CompileError(PyrexError):
self
.
position
=
position
self
.
message
=
message
if
position
:
pos_str
=
"%s:%d:%d: "
%
position
pos_str
=
"%s:%d:%d: "
%
(
position
[
0
].
get_description
(),
position
[
1
],
position
[
2
])
cont
=
context
(
position
)
else
:
pos_str
=
""
...
...
Cython/Compiler/ModuleNode.py
View file @
bddf62c2
...
...
@@ -428,7 +428,7 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
code
.
putln
(
"static char *%s[] = {"
%
Naming
.
filenames_cname
)
if
code
.
filename_list
:
for
source_desc
in
code
.
filename_list
:
filename
=
os
.
path
.
basename
(
s
tr
(
source_desc
))
filename
=
os
.
path
.
basename
(
s
ource_desc
.
get_filenametable_entry
(
))
escaped_filename
=
filename
.
replace
(
"
\
\
"
,
"
\
\
\
\
"
).
replace
(
'"'
,
r'\"'
)
code
.
putln
(
'"%s",'
%
escaped_filename
)
...
...
Cython/Compiler/Scanning.py
View file @
bddf62c2
...
...
@@ -206,7 +206,8 @@ def initial_compile_time_env():
#------------------------------------------------------------------
class
SourceDescriptor
:
pass
def
__str__
(
self
):
assert
False
# To catch all places where a descriptor is used directly as a filename
class
FileSourceDescriptor
(
SourceDescriptor
):
"""
...
...
@@ -230,7 +231,10 @@ class FileSourceDescriptor(SourceDescriptor):
else
:
return
open
(
self
.
filename
)
def
__str__
(
self
):
def
get_description
(
self
):
return
self
.
filename
def
get_filenametable_entry
(
self
):
return
self
.
filename
def
__repr__
(
self
):
...
...
@@ -248,9 +252,12 @@ class StringSourceDescriptor(SourceDescriptor):
def
get_lines
(
self
,
decode
=
False
):
return
self
.
codelines
def
__str__
(
self
):
def
get_description
(
self
):
return
self
.
name
def
get_filenametable_entry
(
self
):
return
"stringsource"
def
__repr__
(
self
):
return
"<StringSourceDescriptor:%s>"
%
self
...
...
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