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
3d064dd1
Commit
3d064dd1
authored
Dec 09, 2010
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
compile fixes in Parsing.py: kwargs names must be bytes before Py2.6
parent
5707c854
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
12 deletions
+13
-12
Cython/Compiler/Parsing.pxd
Cython/Compiler/Parsing.pxd
+1
-1
Cython/Compiler/Parsing.py
Cython/Compiler/Parsing.py
+12
-11
No files found.
Cython/Compiler/Parsing.pxd
View file @
3d064dd1
...
@@ -104,7 +104,7 @@ cdef p_if_clause(PyrexScanner s)
...
@@ -104,7 +104,7 @@ cdef p_if_clause(PyrexScanner s)
cdef
p_else_clause
(
PyrexScanner
s
)
cdef
p_else_clause
(
PyrexScanner
s
)
cdef
p_while_statement
(
PyrexScanner
s
)
cdef
p_while_statement
(
PyrexScanner
s
)
cdef
p_for_statement
(
PyrexScanner
s
)
cdef
p_for_statement
(
PyrexScanner
s
)
cpdef
p_for_bounds
(
PyrexScanner
s
,
bint
allow_testlist
=
*
)
cpdef
dict
p_for_bounds
(
PyrexScanner
s
,
bint
allow_testlist
=
*
)
cdef
p_for_from_relation
(
PyrexScanner
s
)
cdef
p_for_from_relation
(
PyrexScanner
s
)
cdef
p_for_from_step
(
PyrexScanner
s
)
cdef
p_for_from_step
(
PyrexScanner
s
)
cdef
p_target
(
PyrexScanner
s
,
terminator
)
cdef
p_target
(
PyrexScanner
s
,
terminator
)
...
...
Cython/Compiler/Parsing.py
View file @
3d064dd1
...
@@ -877,8 +877,7 @@ def p_comp_for(s, body):
...
@@ -877,8 +877,7 @@ def p_comp_for(s, body):
pos
=
s
.
position
()
pos
=
s
.
position
()
s
.
next
()
s
.
next
()
kw
=
p_for_bounds
(
s
,
allow_testlist
=
False
)
kw
=
p_for_bounds
(
s
,
allow_testlist
=
False
)
kw
[
'else_clause'
]
=
None
kw
.
update
(
else_clause
=
None
,
body
=
p_comp_iter
(
s
,
body
))
kw
[
'body'
]
=
p_comp_iter
(
s
,
body
)
return
Nodes
.
ForStatNode
(
pos
,
**
kw
)
return
Nodes
.
ForStatNode
(
pos
,
**
kw
)
def
p_comp_if
(
s
,
body
):
def
p_comp_if
(
s
,
body
):
...
@@ -1372,8 +1371,9 @@ def p_for_statement(s):
...
@@ -1372,8 +1371,9 @@ def p_for_statement(s):
pos
=
s
.
position
()
pos
=
s
.
position
()
s
.
next
()
s
.
next
()
kw
=
p_for_bounds
(
s
,
allow_testlist
=
True
)
kw
=
p_for_bounds
(
s
,
allow_testlist
=
True
)
kw
[
'body'
]
=
p_suite
(
s
)
body
=
p_suite
(
s
)
kw
[
'else_clause'
]
=
p_else_clause
(
s
)
else_clause
=
p_else_clause
(
s
)
kw
.
update
(
body
=
body
,
else_clause
=
else_clause
)
return
Nodes
.
ForStatNode
(
pos
,
**
kw
)
return
Nodes
.
ForStatNode
(
pos
,
**
kw
)
def
p_for_bounds
(
s
,
allow_testlist
=
True
):
def
p_for_bounds
(
s
,
allow_testlist
=
True
):
...
@@ -1381,7 +1381,7 @@ def p_for_bounds(s, allow_testlist=True):
...
@@ -1381,7 +1381,7 @@ def p_for_bounds(s, allow_testlist=True):
if
s
.
sy
==
'in'
:
if
s
.
sy
==
'in'
:
s
.
next
()
s
.
next
()
iterator
=
p_for_iterator
(
s
,
allow_testlist
)
iterator
=
p_for_iterator
(
s
,
allow_testlist
)
return
{
'target'
:
target
,
'iterator'
:
iterator
}
return
dict
(
target
=
target
,
iterator
=
iterator
)
elif
not
s
.
in_python_file
:
elif
not
s
.
in_python_file
:
if
s
.
sy
==
'from'
:
if
s
.
sy
==
'from'
:
s
.
next
()
s
.
next
()
...
@@ -1408,12 +1408,13 @@ def p_for_bounds(s, allow_testlist=True):
...
@@ -1408,12 +1408,13 @@ def p_for_bounds(s, allow_testlist=True):
if
rel1
[
0
]
!=
rel2
[
0
]:
if
rel1
[
0
]
!=
rel2
[
0
]:
error
(
rel2_pos
,
error
(
rel2_pos
,
"Relation directions in for-from do not match"
)
"Relation directions in for-from do not match"
)
return
{
'target'
:
target
,
return
dict
(
target
=
target
,
'bound1'
:
bound1
,
bound1
=
bound1
,
'relation1'
:
rel1
,
relation1
=
rel1
,
'relation2'
:
rel2
,
relation2
=
rel2
,
'bound2'
:
bound2
,
bound2
=
bound2
,
'step'
:
step
}
step
=
step
,
)
else
:
else
:
s
.
expect
(
'in'
)
s
.
expect
(
'in'
)
return
{}
return
{}
...
...
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