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
350afcaf
Commit
350afcaf
authored
Apr 13, 2011
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix #675: make 'by' a non-keyword also in .pyx files
parent
4202afd2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
3 deletions
+3
-3
Cython/Compiler/Parsing.py
Cython/Compiler/Parsing.py
+1
-1
Cython/Compiler/Scanning.py
Cython/Compiler/Scanning.py
+1
-1
tests/run/for_decrement.pyx
tests/run/for_decrement.pyx
+1
-1
No files found.
Cython/Compiler/Parsing.py
View file @
350afcaf
...
@@ -1432,7 +1432,7 @@ def p_for_from_relation(s):
...
@@ -1432,7 +1432,7 @@ def p_for_from_relation(s):
s
.
error
(
"Expected one of '<', '<=', '>' '>='"
)
s
.
error
(
"Expected one of '<', '<=', '>' '>='"
)
def
p_for_from_step
(
s
):
def
p_for_from_step
(
s
):
if
s
.
sy
==
'by'
:
if
s
.
sy
==
'
IDENT'
and
s
.
systring
==
'
by'
:
s
.
next
()
s
.
next
()
step
=
p_bit_expr
(
s
)
step
=
p_bit_expr
(
s
)
return
step
return
step
...
...
Cython/Compiler/Scanning.py
View file @
350afcaf
...
@@ -45,7 +45,7 @@ py_reserved_words = [
...
@@ -45,7 +45,7 @@ py_reserved_words = [
pyx_reserved_words
=
py_reserved_words
+
[
pyx_reserved_words
=
py_reserved_words
+
[
"include"
,
"ctypedef"
,
"cdef"
,
"cpdef"
,
"include"
,
"ctypedef"
,
"cdef"
,
"cpdef"
,
"cimport"
,
"
by"
,
"
DEF"
,
"IF"
,
"ELIF"
,
"ELSE"
"cimport"
,
"DEF"
,
"IF"
,
"ELIF"
,
"ELSE"
]
]
class
Method
(
object
):
class
Method
(
object
):
...
...
tests/run/for_decrement.pyx
View file @
350afcaf
...
@@ -33,7 +33,7 @@ def from_loop_indices():
...
@@ -33,7 +33,7 @@ def from_loop_indices():
incremented one step after the last iteration.
incremented one step after the last iteration.
"""
"""
cdef
int
i
,
j
,
k
cdef
int
i
,
j
,
k
for
i
from
0
<=
i
<
10
by
get_step
():
pass
for
i
from
0
<=
i
<
5
+
5
by
get_step
():
pass
for
j
from
0
<=
j
<
10
:
pass
for
j
from
0
<=
j
<
10
:
pass
for
k
from
10
>
k
>
0
:
pass
for
k
from
10
>
k
>
0
:
pass
return
i
,
j
,
k
return
i
,
j
,
k
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