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
88fbaece
Commit
88fbaece
authored
Jul 04, 2009
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Py3 code fixes
parent
b0900657
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
10 additions
and
15 deletions
+10
-15
Cython/Compiler/Parsing.py
Cython/Compiler/Parsing.py
+2
-3
Cython/Plex/Errors.py
Cython/Plex/Errors.py
+1
-3
Cython/Plex/Machines.py
Cython/Plex/Machines.py
+1
-2
Cython/Plex/Regexps.py
Cython/Plex/Regexps.py
+1
-1
Cython/Plex/Transitions.py
Cython/Plex/Transitions.py
+5
-6
No files found.
Cython/Compiler/Parsing.py
View file @
88fbaece
...
@@ -10,7 +10,6 @@ cython.declare(Nodes=object, ExprNodes=object, EncodedString=object)
...
@@ -10,7 +10,6 @@ cython.declare(Nodes=object, ExprNodes=object, EncodedString=object)
import
os
import
os
import
re
import
re
import
sys
import
sys
from
types
import
ListType
,
TupleType
from
Cython.Compiler.Scanning
import
PyrexScanner
,
FileSourceDescriptor
from
Cython.Compiler.Scanning
import
PyrexScanner
,
FileSourceDescriptor
import
Nodes
import
Nodes
import
ExprNodes
import
ExprNodes
...
@@ -2617,7 +2616,7 @@ def print_parse_tree(f, node, level, key = None):
...
@@ -2617,7 +2616,7 @@ def print_parse_tree(f, node, level, key = None):
if key:
if key:
f.write("
%
s
:
" % key)
f.write("
%
s
:
" % key)
t = type(node)
t = type(node)
if t
== TupleTyp
e:
if t
is tupl
e:
f.write("
(
%
s
@
%
s
\
n
" % (node[0], node[1]))
f.write("
(
%
s
@
%
s
\
n
" % (node[0], node[1]))
for i in xrange(2, len(node)):
for i in xrange(2, len(node)):
print_parse_tree(f, node[i], level+1)
print_parse_tree(f, node[i], level+1)
...
@@ -2633,7 +2632,7 @@ def print_parse_tree(f, node, level, key = None):
...
@@ -2633,7 +2632,7 @@ def print_parse_tree(f, node, level, key = None):
if name != 'tag' and name != 'pos':
if name != 'tag' and name != 'pos':
print_parse_tree(f, value, level+1, name)
print_parse_tree(f, value, level+1, name)
return
return
elif t
== ListType
:
elif t
is list
:
f.write("
[
\
n
")
f.write("
[
\
n
")
for i in xrange(len(node)):
for i in xrange(len(node)):
print_parse_tree(f, node[i], level+1)
print_parse_tree(f, node[i], level+1)
...
...
Cython/Plex/Errors.py
View file @
88fbaece
...
@@ -6,9 +6,7 @@
...
@@ -6,9 +6,7 @@
#
#
#=======================================================================
#=======================================================================
import
exceptions
class
PlexError
(
Exception
):
class
PlexError
(
exceptions
.
Exception
):
message
=
""
message
=
""
class
PlexTypeError
(
PlexError
,
TypeError
):
class
PlexTypeError
(
PlexError
,
TypeError
):
...
...
Cython/Plex/Machines.py
View file @
88fbaece
...
@@ -8,7 +8,6 @@
...
@@ -8,7 +8,6 @@
import
sys
import
sys
from
sys
import
maxint
from
sys
import
maxint
from
types
import
TupleType
from
Transitions
import
TransitionMap
from
Transitions
import
TransitionMap
...
@@ -169,7 +168,7 @@ class FastMachine(object):
...
@@ -169,7 +168,7 @@ class FastMachine(object):
self
.
initial_states
[
name
]
=
state
self
.
initial_states
[
name
]
=
state
def
add_transitions
(
self
,
state
,
event
,
new_state
):
def
add_transitions
(
self
,
state
,
event
,
new_state
):
if
type
(
event
)
==
TupleTyp
e
:
if
type
(
event
)
is
tupl
e
:
code0
,
code1
=
event
code0
,
code1
=
event
if
code0
==
-
maxint
:
if
code0
==
-
maxint
:
state
[
'else'
]
=
new_state
state
[
'else'
]
=
new_state
...
...
Cython/Plex/Regexps.py
View file @
88fbaece
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
import
array
import
array
import
types
import
types
from
sys
import
maxint
from
sys
import
maxint
as
maxint
import
Errors
import
Errors
...
...
Cython/Plex/Transitions.py
View file @
88fbaece
...
@@ -6,8 +6,7 @@
...
@@ -6,8 +6,7 @@
#
#
from
copy
import
copy
from
copy
import
copy
from
sys
import
maxint
from
sys
import
maxint
as
maxint
from
types
import
TupleType
class
TransitionMap
(
object
):
class
TransitionMap
(
object
):
"""
"""
...
@@ -50,11 +49,11 @@ class TransitionMap(object):
...
@@ -50,11 +49,11 @@ class TransitionMap(object):
#self.check() ###
#self.check() ###
def
add
(
self
,
event
,
new_state
,
def
add
(
self
,
event
,
new_state
,
TupleType
=
TupleTyp
e
):
TupleType
=
tupl
e
):
"""
"""
Add transition to |new_state| on |event|.
Add transition to |new_state| on |event|.
"""
"""
if
type
(
event
)
==
TupleType
:
if
type
(
event
)
is
TupleType
:
code0
,
code1
=
event
code0
,
code1
=
event
i
=
self
.
split
(
code0
)
i
=
self
.
split
(
code0
)
j
=
self
.
split
(
code1
)
j
=
self
.
split
(
code1
)
...
@@ -66,11 +65,11 @@ class TransitionMap(object):
...
@@ -66,11 +65,11 @@ class TransitionMap(object):
self
.
get_special
(
event
)[
new_state
]
=
1
self
.
get_special
(
event
)[
new_state
]
=
1
def
add_set
(
self
,
event
,
new_set
,
def
add_set
(
self
,
event
,
new_set
,
TupleType
=
TupleTyp
e
):
TupleType
=
tupl
e
):
"""
"""
Add transitions to the states in |new_set| on |event|.
Add transitions to the states in |new_set| on |event|.
"""
"""
if
type
(
event
)
==
TupleType
:
if
type
(
event
)
is
TupleType
:
code0
,
code1
=
event
code0
,
code1
=
event
i
=
self
.
split
(
code0
)
i
=
self
.
split
(
code0
)
j
=
self
.
split
(
code1
)
j
=
self
.
split
(
code1
)
...
...
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