Commit e1e5f01a authored by Kevin Modzelewski's avatar Kevin Modzelewski

Format and lint checks

parent dcae8bea
...@@ -16,8 +16,8 @@ ...@@ -16,8 +16,8 @@
#include <cstring> #include <cstring>
#include "runtime/gc_runtime.h" #include "runtime/gc_runtime.h"
#include "runtime/objmodel.h"
#include "runtime/list.h" #include "runtime/list.h"
#include "runtime/objmodel.h"
namespace pyston { namespace pyston {
...@@ -53,7 +53,7 @@ Box* listiterNext(Box* s) { ...@@ -53,7 +53,7 @@ Box* listiterNext(Box* s) {
assert(s->cls == list_iterator_cls); assert(s->cls == list_iterator_cls);
BoxedListIterator* self = static_cast<BoxedListIterator*>(s); 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, ""); raiseExcHelper(StopIteration, "");
} }
......
...@@ -51,10 +51,9 @@ Box* tupleiterNext(Box* s) { ...@@ -51,10 +51,9 @@ Box* tupleiterNext(Box* s) {
if (!(self->pos >= 0 && self->pos < self->t->elts.size())) { if (!(self->pos >= 0 && self->pos < self->t->elts.size())) {
raiseExcHelper(StopIteration, ""); raiseExcHelper(StopIteration, "");
} }
Box* rtn = self->t->elts[self->pos]; Box* rtn = self->t->elts[self->pos];
self->pos++; self->pos++;
return rtn; return rtn;
} }
} }
...@@ -208,8 +208,8 @@ void setupTuple() { ...@@ -208,8 +208,8 @@ void setupTuple() {
tuple_cls->giveAttr("__getitem__", new BoxedFunction(boxRTFunction((void*)tupleGetitem, NULL, 2, false))); 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("__contains__", new BoxedFunction(boxRTFunction((void*)tupleContains, NULL, 2, false)));
tuple_cls->giveAttr("__iter__", tuple_cls->giveAttr(
new BoxedFunction(boxRTFunction((void*)tupleIter, typeFromClass(tuple_iterator_cls), 1, false))); "__iter__", new BoxedFunction(boxRTFunction((void*)tupleIter, typeFromClass(tuple_iterator_cls), 1, false)));
tuple_cls->giveAttr("__lt__", new BoxedFunction(boxRTFunction((void*)tupleLt, NULL, 2, false))); tuple_cls->giveAttr("__lt__", new BoxedFunction(boxRTFunction((void*)tupleLt, NULL, 2, false)));
...@@ -232,8 +232,8 @@ void setupTuple() { ...@@ -232,8 +232,8 @@ void setupTuple() {
CLFunction* hasnext = boxRTFunction((void*)tupleiterHasnextUnboxed, BOOL, 1, false); CLFunction* hasnext = boxRTFunction((void*)tupleiterHasnextUnboxed, BOOL, 1, false);
addRTFunction(hasnext, (void*)tupleiterHasnext, BOXED_BOOL, 1, false); addRTFunction(hasnext, (void*)tupleiterHasnext, BOXED_BOOL, 1, false);
tuple_iterator_cls->giveAttr("__hasnext__", new BoxedFunction(hasnext)); tuple_iterator_cls->giveAttr("__hasnext__", new BoxedFunction(hasnext));
tuple_iterator_cls->giveAttr( tuple_iterator_cls->giveAttr("__iter__", new BoxedFunction(boxRTFunction(
"__iter__", new BoxedFunction(boxRTFunction((void*)tupleIterIter, typeFromClass(tuple_iterator_cls), 1, false))); (void*)tupleIterIter, typeFromClass(tuple_iterator_cls), 1, false)));
tuple_iterator_cls->giveAttr("next", new BoxedFunction(boxRTFunction((void*)tupleiterNext, UNKNOWN, 1, false))); tuple_iterator_cls->giveAttr("next", new BoxedFunction(boxRTFunction((void*)tupleiterNext, UNKNOWN, 1, false)));
tuple_iterator_cls->freeze(); tuple_iterator_cls->freeze();
......
...@@ -301,7 +301,8 @@ Box* exceptionNew1(BoxedClass* cls); ...@@ -301,7 +301,8 @@ Box* exceptionNew1(BoxedClass* cls);
Box* exceptionNew2(BoxedClass* cls, Box* message); Box* exceptionNew2(BoxedClass* cls, Box* message);
extern BoxedClass* Exception, *AssertionError, *AttributeError, *TypeError, *NameError, *KeyError, *IndexError, 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. // cls should be obj->cls.
// Added as parameter because it should typically be available // 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