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
aa420b73
Commit
aa420b73
authored
Apr 23, 2008
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed end marker in control flow engine
parent
4920f46d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
Cython/Compiler/ControlFlow.py
Cython/Compiler/ControlFlow.py
+6
-4
No files found.
Cython/Compiler/ControlFlow.py
View file @
aa420b73
import
bisect
import
bisect
,
sys
# This module keeps track of arbitrary "states" at any point of the code.
# This module keeps track of arbitrary "states" at any point of the code.
# A state is considered known if every path to the given point agrees on
# A state is considered known if every path to the given point agrees on
...
@@ -13,6 +13,8 @@ import bisect
...
@@ -13,6 +13,8 @@ import bisect
# redesigned. It doesn't take return, raise, continue, or break into
# redesigned. It doesn't take return, raise, continue, or break into
# account.
# account.
_END_POS
=
((
unichr
(
sys
.
maxunicode
)
*
10
),())
class
ControlFlow
:
class
ControlFlow
:
def
__init__
(
self
,
start_pos
,
incoming
,
parent
):
def
__init__
(
self
,
start_pos
,
incoming
,
parent
):
...
@@ -22,7 +24,7 @@ class ControlFlow:
...
@@ -22,7 +24,7 @@ class ControlFlow:
parent
=
incoming
.
parent
parent
=
incoming
.
parent
self
.
parent
=
parent
self
.
parent
=
parent
self
.
tip
=
{}
self
.
tip
=
{}
self
.
end_pos
=
((),)
self
.
end_pos
=
_END_POS
def
start_branch
(
self
,
pos
):
def
start_branch
(
self
,
pos
):
self
.
end_pos
=
pos
self
.
end_pos
=
pos
...
@@ -40,10 +42,10 @@ class ControlFlow:
...
@@ -40,10 +42,10 @@ class ControlFlow:
self
.
parent
.
end_pos
=
pos
self
.
parent
.
end_pos
=
pos
return
LinearControlFlow
(
pos
,
self
.
parent
)
return
LinearControlFlow
(
pos
,
self
.
parent
)
def
get_state
(
self
,
item
,
pos
=
((),())
):
def
get_state
(
self
,
item
,
pos
=
_END_POS
):
return
self
.
get_pos_state
(
item
,
pos
)[
1
]
return
self
.
get_pos_state
(
item
,
pos
)[
1
]
def
get_pos_state
(
self
,
item
,
pos
=
((),())
):
def
get_pos_state
(
self
,
item
,
pos
=
_END_POS
):
# do some caching
# do some caching
if
pos
>
self
.
end_pos
:
if
pos
>
self
.
end_pos
:
try
:
try
:
...
...
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