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
Boxiang Sun
cython
Commits
7bdafc9e
Commit
7bdafc9e
authored
Dec 29, 2010
by
Vitja Makarov
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote branch 'upstream/master'
parents
7f630812
ed53fdd9
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
6 deletions
+21
-6
Cython/Compiler/Annotate.py
Cython/Compiler/Annotate.py
+1
-1
Cython/Compiler/Main.py
Cython/Compiler/Main.py
+15
-3
Cython/Compiler/Scanning.py
Cython/Compiler/Scanning.py
+5
-2
No files found.
Cython/Compiler/Annotate.py
View file @
7bdafc9e
...
...
@@ -44,7 +44,7 @@ class AnnotationCCodeWriter(CCodeWriter):
if
pos
is
not
None
:
CCodeWriter
.
mark_pos
(
self
,
pos
)
if
self
.
last_pos
:
pos_code
=
self
.
code
.
setdefault
(
self
.
last_pos
[
0
].
get_description
()
,{})
pos_code
=
self
.
code
.
setdefault
(
self
.
last_pos
[
0
].
filename
,{})
code
=
pos_code
.
get
(
self
.
last_pos
[
1
],
""
)
pos_code
[
self
.
last_pos
[
1
]]
=
code
+
self
.
annotation_buffer
.
getvalue
()
self
.
annotation_buffer
=
StringIO
()
...
...
Cython/Compiler/Main.py
View file @
7bdafc9e
...
...
@@ -311,7 +311,10 @@ class Context(object):
try
:
if
debug_find_module
:
print
(
"Context.find_module: Parsing %s"
%
pxd_pathname
)
source_desc
=
FileSourceDescriptor
(
pxd_pathname
)
rel_path
=
module_name
.
replace
(
'.'
,
os
.
sep
)
+
os
.
path
.
splitext
(
pxd_pathname
)[
1
]
if
not
pxd_pathname
.
endswith
(
rel_path
):
rel_path
=
pxd_pathname
# safety measure to prevent printing incorrect paths
source_desc
=
FileSourceDescriptor
(
pxd_pathname
,
rel_path
)
err
,
result
=
self
.
process_pxd
(
source_desc
,
scope
,
module_name
)
if
err
:
raise
err
...
...
@@ -584,15 +587,23 @@ def run_pipeline(source, options, full_module_name = None):
# Set up source object
cwd
=
os
.
getcwd
()
source_desc
=
FileSourceDescriptor
(
os
.
path
.
join
(
cwd
,
source
))
abs_path
=
os
.
path
.
abspath
(
source
)
source_ext
=
os
.
path
.
splitext
(
source
)[
1
]
full_module_name
=
full_module_name
or
context
.
extract_module_name
(
source
,
options
)
if
options
.
relative_path_in_code_position_comments
:
rel_path
=
full_module_name
.
replace
(
'.'
,
os
.
sep
)
+
source_ext
if
not
abs_path
.
endswith
(
rel_path
):
rel_path
=
source
# safety measure to prevent printing incorrect paths
else
:
rel_path
=
abs_path
source_desc
=
FileSourceDescriptor
(
abs_path
,
rel_path
)
source
=
CompilationSource
(
source_desc
,
full_module_name
,
cwd
)
# Set up result object
result
=
create_default_resultobj
(
source
,
options
)
# Get pipeline
if
source_
desc
.
filename
.
endswith
(
".py"
)
:
if
source_
ext
.
lower
()
==
'.py'
:
pipeline
=
context
.
create_py_pipeline
(
options
,
result
)
else
:
pipeline
=
context
.
create_pyx_pipeline
(
options
,
result
)
...
...
@@ -820,6 +831,7 @@ default_options = dict(
compiler_directives
=
{},
evaluate_tree_assertions
=
False
,
emit_linenums
=
False
,
relative_path_in_code_position_comments
=
True
,
language_level
=
2
,
gdb_debug
=
False
,
)
Cython/Compiler/Scanning.py
View file @
7bdafc9e
...
...
@@ -166,8 +166,9 @@ class FileSourceDescriptor(SourceDescriptor):
optional name argument and will be passed back when asking for
the position()-tuple.
"""
def
__init__
(
self
,
filename
):
def
__init__
(
self
,
filename
,
path_description
=
None
):
filename
=
Utils
.
decode_filename
(
filename
)
self
.
path_description
=
path_description
or
filename
self
.
filename
=
filename
self
.
set_file_type_from_name
(
filename
)
self
.
_cmp_name
=
filename
...
...
@@ -180,7 +181,7 @@ class FileSourceDescriptor(SourceDescriptor):
require_normalised_newlines
=
False
)
def
get_description
(
self
):
return
self
.
filename
return
self
.
path_description
def
get_filenametable_entry
(
self
):
return
self
.
filename
...
...
@@ -199,6 +200,8 @@ class StringSourceDescriptor(SourceDescriptor):
Instances of this class can be used instead of a filenames if the
code originates from a string object.
"""
filename
=
None
def
__init__
(
self
,
name
,
code
):
self
.
name
=
name
#self.set_file_type_from_name(name)
...
...
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