Commit e1e5f01a authored by Kevin Modzelewski's avatar Kevin Modzelewski

Format and lint checks

parent dcae8bea
......@@ -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, "");
}
......
......@@ -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;
}
}
......@@ -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();
......
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment