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
e8330efc
Commit
e8330efc
authored
Jul 27, 2014
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
support passing code strings into analyse()
parent
8b5aec39
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
Cython/Compiler/JediTyper.py
Cython/Compiler/JediTyper.py
+4
-2
No files found.
Cython/Compiler/JediTyper.py
View file @
e8330efc
...
@@ -16,12 +16,14 @@ default_type_map = {
...
@@ -16,12 +16,14 @@ default_type_map = {
}
}
def
analyse
(
source_path
):
def
analyse
(
source_path
=
None
,
code
=
None
):
"""
"""
Analyse a Python source code file with Jedi.
Analyse a Python source code file with Jedi.
Returns a mapping from (scope-name, (line, column)) pairs to a name-types mapping.
Returns a mapping from (scope-name, (line, column)) pairs to a name-types mapping.
"""
"""
script
=
Script
(
path
=
source_path
)
if
not
source_path
and
code
is
None
:
raise
ValueError
(
"Either 'source_path' or 'code' is required."
)
script
=
Script
(
source
=
code
,
path
=
source_path
)
evaluator
=
script
.
_evaluator
evaluator
=
script
.
_evaluator
scoped_names
=
{}
scoped_names
=
{}
for
statements
in
script
.
_parser
.
module
().
used_names
.
values
():
for
statements
in
script
.
_parser
.
module
().
used_names
.
values
():
...
...
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