Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
Pyston
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
Pyston
Commits
e1e5f01a
Commit
e1e5f01a
authored
Jun 03, 2014
by
Kevin Modzelewski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Format and lint checks
parent
dcae8bea
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
9 deletions
+9
-9
src/runtime/inline/list.cpp
src/runtime/inline/list.cpp
+2
-2
src/runtime/inline/tuple.cpp
src/runtime/inline/tuple.cpp
+1
-2
src/runtime/tuple.cpp
src/runtime/tuple.cpp
+4
-4
src/runtime/types.h
src/runtime/types.h
+2
-1
No files found.
src/runtime/inline/list.cpp
View file @
e1e5f01a
...
...
@@ -16,8 +16,8 @@
#include <cstring>
#include "runtime/gc_runtime.h"
#include "runtime/objmodel.h"
#include "runtime/list.h"
#include "runtime/objmodel.h"
namespace
pyston
{
...
...
@@ -53,7 +53,7 @@ Box* listiterNext(Box* s) {
assert
(
s
->
cls
==
list_iterator_cls
);
BoxedListIterator
*
self
=
static_cast
<
BoxedListIterator
*>
(
s
);
if
(
!
(
self
->
pos
>=
0
&&
self
->
pos
<
self
->
l
->
size
))
{
if
(
!
(
self
->
pos
>=
0
&&
self
->
pos
<
self
->
l
->
size
))
{
raiseExcHelper
(
StopIteration
,
""
);
}
...
...
src/runtime/inline/tuple.cpp
View file @
e1e5f01a
...
...
@@ -51,10 +51,9 @@ Box* tupleiterNext(Box* s) {
if
(
!
(
self
->
pos
>=
0
&&
self
->
pos
<
self
->
t
->
elts
.
size
()))
{
raiseExcHelper
(
StopIteration
,
""
);
}
Box
*
rtn
=
self
->
t
->
elts
[
self
->
pos
];
self
->
pos
++
;
return
rtn
;
}
}
src/runtime/tuple.cpp
View file @
e1e5f01a
...
...
@@ -208,8 +208,8 @@ void setupTuple() {
tuple_cls
->
giveAttr
(
"__getitem__"
,
new
BoxedFunction
(
boxRTFunction
((
void
*
)
tupleGetitem
,
NULL
,
2
,
false
)));
tuple_cls
->
giveAttr
(
"__contains__"
,
new
BoxedFunction
(
boxRTFunction
((
void
*
)
tupleContains
,
NULL
,
2
,
false
)));
tuple_cls
->
giveAttr
(
"__iter__"
,
new
BoxedFunction
(
boxRTFunction
((
void
*
)
tupleIter
,
typeFromClass
(
tuple_iterator_cls
),
1
,
false
)));
tuple_cls
->
giveAttr
(
"__iter__"
,
new
BoxedFunction
(
boxRTFunction
((
void
*
)
tupleIter
,
typeFromClass
(
tuple_iterator_cls
),
1
,
false
)));
tuple_cls
->
giveAttr
(
"__lt__"
,
new
BoxedFunction
(
boxRTFunction
((
void
*
)
tupleLt
,
NULL
,
2
,
false
)));
...
...
@@ -232,8 +232,8 @@ void setupTuple() {
CLFunction
*
hasnext
=
boxRTFunction
((
void
*
)
tupleiterHasnextUnboxed
,
BOOL
,
1
,
false
);
addRTFunction
(
hasnext
,
(
void
*
)
tupleiterHasnext
,
BOXED_BOOL
,
1
,
false
);
tuple_iterator_cls
->
giveAttr
(
"__hasnext__"
,
new
BoxedFunction
(
hasnext
));
tuple_iterator_cls
->
giveAttr
(
"__iter__"
,
new
BoxedFunction
(
boxRTFunction
(
(
void
*
)
tupleIterIter
,
typeFromClass
(
tuple_iterator_cls
),
1
,
false
)));
tuple_iterator_cls
->
giveAttr
(
"__iter__"
,
new
BoxedFunction
(
boxRTFunction
(
(
void
*
)
tupleIterIter
,
typeFromClass
(
tuple_iterator_cls
),
1
,
false
)));
tuple_iterator_cls
->
giveAttr
(
"next"
,
new
BoxedFunction
(
boxRTFunction
((
void
*
)
tupleiterNext
,
UNKNOWN
,
1
,
false
)));
tuple_iterator_cls
->
freeze
();
...
...
src/runtime/types.h
View file @
e1e5f01a
...
...
@@ -301,7 +301,8 @@ Box* exceptionNew1(BoxedClass* cls);
Box
*
exceptionNew2
(
BoxedClass
*
cls
,
Box
*
message
);
extern
BoxedClass
*
Exception
,
*
AssertionError
,
*
AttributeError
,
*
TypeError
,
*
NameError
,
*
KeyError
,
*
IndexError
,
*
IOError
,
*
OSError
,
*
ZeroDivisionError
,
*
ValueError
,
*
UnboundLocalError
,
*
RuntimeError
,
*
ImportError
,
*
StopIteration
;
*
IOError
,
*
OSError
,
*
ZeroDivisionError
,
*
ValueError
,
*
UnboundLocalError
,
*
RuntimeError
,
*
ImportError
,
*
StopIteration
;
// cls should be obj->cls.
// Added as parameter because it should typically be available
...
...
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