Commit cd73ad20 authored by Travis Hance's avatar Travis Hance Committed by Travis Hance

made descr file

parent 26de61ba
// Copyright (c) 2014 Dropbox, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include "codegen/compvars.h"
#include "runtime/types.h"
namespace pyston {
static Box* memberGet(BoxedMemberDescriptor* self, Box* inst, Box* owner) {
RELEASE_ASSERT(self->cls == member_cls, "");
Py_FatalError("unimplemented");
}
void setupDescr() {
member_cls->giveAttr("__name__", boxStrConstant("member"));
member_cls->giveAttr("__get__", new BoxedFunction(boxRTFunction((void*)memberGet, UNKNOWN, 3)));
member_cls->freeze();
}
void teardownDescr() {
}
}
// Copyright (c) 2014 Dropbox, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// you may not use this file except in compliance with the License. // You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
......@@ -386,12 +385,6 @@ static Box* functionGet(BoxedFunction* self, Box* inst, Box* owner) {
return boxInstanceMethod(inst, self);
}
static Box* memberGet(BoxedMemberDescriptor* self, Box* inst, Box* owner) {
RELEASE_ASSERT(self->cls == member_cls, "");
Py_FatalError("unimplemented");
}
static Box* functionCall(BoxedFunction* self, Box* args, Box* kwargs) {
RELEASE_ASSERT(self->cls == function_cls, "%s", getTypeName(self)->c_str());
......@@ -755,10 +748,6 @@ void setupRuntime() {
module_cls->giveAttr("__str__", module_cls->getattr("__repr__"));
module_cls->freeze();
member_cls->giveAttr("__name__", boxStrConstant("member"));
member_cls->giveAttr("__get__", new BoxedFunction(boxRTFunction((void*)memberGet, UNKNOWN, 3)));
member_cls->freeze();
closure_cls->giveAttr("__name__", boxStrConstant("closure"));
closure_cls->freeze();
......@@ -778,6 +767,7 @@ void setupRuntime() {
setupClassobj();
setupSuper();
setupUnicode();
setupDescr();
function_cls->giveAttr("__name__", boxStrConstant("function"));
function_cls->giveAttr("__repr__", new BoxedFunction(boxRTFunction((void*)functionRepr, STR, 1)));
......@@ -881,6 +871,7 @@ void teardownRuntime() {
teardownSet();
teardownTuple();
teardownFile();
teardownDescr();
/*
// clear all the attributes on the base classes before freeing the classes themselves,
......
......@@ -63,6 +63,8 @@ void setupCAPI();
void teardownCAPI();
void setupGenerator();
void setupUnicode();
void setupDescr();
void teardownDescr();
void setupSys();
void setupBuiltins();
......
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