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
305e7ba8
Commit
305e7ba8
authored
Oct 29, 2010
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Index: Cython/Compiler/Parsing.py
parent
0f9ba0d2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
14 deletions
+39
-14
Cython/Compiler/Parsing.py
Cython/Compiler/Parsing.py
+13
-14
tests/compile/ellipsis_T488.pyx
tests/compile/ellipsis_T488.pyx
+6
-0
tests/run/ellipsis_T488.pyx
tests/run/ellipsis_T488.pyx
+20
-0
No files found.
Cython/Compiler/Parsing.py
View file @
305e7ba8
...
...
@@ -497,20 +497,16 @@ def p_subscript(s):
# 1, 2 or 3 ExprNodes, depending on how
# many slice elements were encountered.
pos
=
s
.
position
()
if
s
.
sy
==
'.'
:
expect_ellipsis
(
s
)
return
[
ExprNodes
.
EllipsisNode
(
pos
)]
else
:
start
=
p_slice_element
(
s
,
(
':'
,))
if
s
.
sy
!=
':'
:
return
[
start
]
s
.
next
()
stop
=
p_slice_element
(
s
,
(
':'
,
','
,
']'
))
if
s
.
sy
!=
':'
:
return
[
start
,
stop
]
s
.
next
()
step
=
p_slice_element
(
s
,
(
':'
,
','
,
']'
))
return
[
start
,
stop
,
step
]
start
=
p_slice_element
(
s
,
(
':'
,))
if
s
.
sy
!=
':'
:
return
[
start
]
s
.
next
()
stop
=
p_slice_element
(
s
,
(
':'
,
','
,
']'
))
if
s
.
sy
!=
':'
:
return
[
start
,
stop
]
s
.
next
()
step
=
p_slice_element
(
s
,
(
':'
,
','
,
']'
))
return
[
start
,
stop
,
step
]
def
p_slice_element
(
s
,
follow_set
):
# Simple expression which may be missing iff
...
...
@@ -569,6 +565,9 @@ def p_atom(s):
return
p_dict_or_set_maker
(
s
)
elif
sy
==
'`'
:
return
p_backquote_expr
(
s
)
elif
sy
==
'.'
:
expect_ellipsis
(
s
)
return
ExprNodes
.
EllipsisNode
(
pos
)
elif
sy
==
'INT'
:
value
=
s
.
systring
s
.
next
()
...
...
tests/compile/ellipsis_T488.pyx
0 → 100644
View file @
305e7ba8
#from ... import foo
print
...
def
test
():
x
=
...
assert
x
is
Ellipsis
tests/run/ellipsis_T488.pyx
0 → 100644
View file @
305e7ba8
"""
>>> test()
"""
def
test
():
x
=
...
assert
x
is
Ellipsis
d
=
{}
d
[...]
=
1
assert
d
[...]
==
1
del
d
[...]
assert
...
not
in
d
d
[...,
...]
=
1
assert
d
[...,
...]
==
1
assert
d
[...,
Ellipsis
]
==
1
assert
(
Ellipsis
,
Ellipsis
)
in
d
del
d
[...,
...]
assert
(
Ellipsis
,
Ellipsis
)
not
in
d
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