Commit 96555a1e authored by Kevin Modzelewski's avatar Kevin Modzelewski

ellipsis fix

parent a303f67a
......@@ -197,7 +197,7 @@ private:
}
}
void* visit_ellipsis(AST_Ellipsis* node) override { return ELLIPSIS; }
void* visit_ellipsis(AST_Ellipsis* node) override { return typeFromClass(ellipsis_cls); }
void* visit_attribute(AST_Attribute* node) override {
CompilerType* t = getType(node->value);
......
......@@ -2127,7 +2127,7 @@ public:
}
};
std::unordered_map<BoxedClass*, NormalObjectType*> NormalObjectType::made;
ConcreteCompilerType* STR, *BOXED_INT, *BOXED_FLOAT, *BOXED_BOOL, *NONE, *ELLIPSIS;
ConcreteCompilerType* STR, *BOXED_INT, *BOXED_FLOAT, *BOXED_BOOL, *NONE;
class ClosureType : public ConcreteCompilerType {
public:
......
......@@ -93,8 +93,8 @@ template <class V> class ValuedCompilerType;
typedef ValuedCompilerType<llvm::Value*> ConcreteCompilerType;
ConcreteCompilerType* typeFromClass(BoxedClass*);
extern ConcreteCompilerType* UNBOXED_INT, *BOXED_INT, *LONG, *UNBOXED_FLOAT, *BOXED_FLOAT, *UNKNOWN, *BOOL, *STR, *NONE, *LIST,
*SLICE, *ELLIPSIS, *MODULE, *DICT, *BOOL, *BOXED_BOOL, *BOXED_TUPLE, *SET, *FROZENSET, *CLOSURE, *GENERATOR,
extern ConcreteCompilerType* UNBOXED_INT, *BOXED_INT, *LONG, *UNBOXED_FLOAT, *BOXED_FLOAT, *UNKNOWN, *BOOL, *STR, *NONE,
*LIST, *SLICE, *MODULE, *DICT, *BOOL, *BOXED_BOOL, *BOXED_TUPLE, *SET, *FROZENSET, *CLOSURE, *GENERATOR,
*BOXED_COMPLEX, *FRAME_INFO;
extern CompilerType* UNDEF, *INT, *FLOAT;
......
......@@ -1524,12 +1524,16 @@ Box* builtinFormat(Box* value, Box* format_spec) {
return res;
}
extern "C" {
BoxedClass* ellipsis_cls;
}
void setupBuiltins() {
builtins_module = createModule(boxString("__builtin__"), NULL,
"Built-in functions, exceptions, and other objects.\n\nNoteworthy: None is "
"the `nil' object; Ellipsis represents `...' in slices.");
BoxedClass* ellipsis_cls = BoxedClass::create(type_cls, object_cls, NULL, 0, 0, sizeof(Box), false, "ellipsis");
ellipsis_cls = BoxedClass::create(type_cls, object_cls, NULL, 0, 0, sizeof(Box), false, "ellipsis");
ellipsis_cls->giveAttr("__repr__", new BoxedFunction(boxRTFunction((void*)ellipsisRepr, STR, 1)));
Ellipsis = new (ellipsis_cls) Box();
assert(Ellipsis->cls);
......
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