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
ba75e1df
Commit
ba75e1df
authored
Aug 21, 2017
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify TrackNumpyAttributes transform.
parent
96b20eb0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
5 deletions
+9
-5
Cython/Compiler/ParseTreeTransforms.py
Cython/Compiler/ParseTreeTransforms.py
+8
-3
Cython/Compiler/Pipeline.py
Cython/Compiler/Pipeline.py
+1
-2
No files found.
Cython/Compiler/ParseTreeTransforms.py
View file @
ba75e1df
...
...
@@ -611,9 +611,11 @@ class PxdPostParse(CythonTransform, SkipDeclarations):
else
:
return
node
class
TrackNumpyAttributes
(
CythonTransform
,
SkipDeclarations
):
def
__init__
(
self
,
context
):
super
(
TrackNumpyAttributes
,
self
).
__init__
(
context
)
class
TrackNumpyAttributes
(
VisitorTransform
,
SkipDeclarations
):
# TODO: Make name handling as good as in InterpretCompilerDirectives() below - probably best to merge the two.
def
__init__
(
self
):
super
(
TrackNumpyAttributes
,
self
).
__init__
()
self
.
numpy_module_names
=
set
()
def
visit_CImportStatNode
(
self
,
node
):
...
...
@@ -627,6 +629,9 @@ class TrackNumpyAttributes(CythonTransform, SkipDeclarations):
node
.
is_numpy_attribute
=
True
return
node
visit_Node
=
VisitorTransform
.
recurse_to_children
class
InterpretCompilerDirectives
(
CythonTransform
,
SkipDeclarations
):
"""
After parsing, directives can be stored in a number of places:
...
...
Cython/Compiler/Pipeline.py
View file @
ba75e1df
...
...
@@ -6,7 +6,6 @@ from time import time
from
.
import
Errors
from
.
import
DebugFlags
from
.
import
Options
from
.Visitor
import
CythonTransform
from
.Errors
import
CompileError
,
InternalError
,
AbortError
from
.
import
Naming
...
...
@@ -183,7 +182,7 @@ def create_pipeline(context, mode, exclude_classes=()):
NormalizeTree
(
context
),
PostParse
(
context
),
_specific_post_parse
,
TrackNumpyAttributes
(
context
),
TrackNumpyAttributes
(),
InterpretCompilerDirectives
(
context
,
context
.
compiler_directives
),
ParallelRangeTransform
(
context
),
AdjustDefByDirectives
(
context
),
...
...
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