|
@@ -47,21 +47,45 @@ ResultType object_new_(OFFICAL_FUNCTIONSIG){
|
|
ResultType object_repo_(OFFICAL_FUNCTIONSIG){
|
|
ResultType object_repo_(OFFICAL_FUNCTIONSIG){
|
|
ArgumentParser ap[] = {{.type=only_value, .must=1, .long_arg=false},
|
|
ArgumentParser ap[] = {{.type=only_value, .must=1, .long_arg=false},
|
|
{.must=-1}};
|
|
{.must=-1}};
|
|
- char repo[200] = {};
|
|
|
|
|
|
+ char *repo;
|
|
|
|
+ char *name;
|
|
|
|
+ char *type;
|
|
|
|
+ size_t len;
|
|
|
|
+ LinkValue *name_value;
|
|
setResultCore(result);
|
|
setResultCore(result);
|
|
parserArgumentUnion(ap, arg, CALL_INTER_FUNCTIONSIG_NOT_ST(var_list, result, belong));
|
|
parserArgumentUnion(ap, arg, CALL_INTER_FUNCTIONSIG_NOT_ST(var_list, result, belong));
|
|
if (!CHECK_RESULT(result))
|
|
if (!CHECK_RESULT(result))
|
|
return result->type;
|
|
return result->type;
|
|
freeResult(result);
|
|
freeResult(result);
|
|
- snprintf(repo, 200, "(object on %p)", ap[0].value->value);
|
|
|
|
|
|
+
|
|
|
|
+ name_value = findAttributes(inter->data.object_name, false, ap[0].value, inter);
|
|
|
|
+ if (name_value != NULL){
|
|
|
|
+ gc_addTmpLink(&name_value->gc_status);
|
|
|
|
+ name = getRepo(name_value, 0, "sys", CALL_INTER_FUNCTIONSIG_NOT_ST(var_list, result, belong));
|
|
|
|
+ gc_freeTmpLink(&name_value->gc_status);
|
|
|
|
+ if (!CHECK_RESULT(result))
|
|
|
|
+ return result->type;
|
|
|
|
+ freeResult(result);
|
|
|
|
+ } else
|
|
|
|
+ name = "unknown";
|
|
|
|
+
|
|
|
|
+ if (ap[0].value->value->type == class)
|
|
|
|
+ type = "class";
|
|
|
|
+ else
|
|
|
|
+ type = "object";
|
|
|
|
+
|
|
|
|
+ len = memStrlen(name) + 26;
|
|
|
|
+ repo = memCalloc(len, sizeof(char ));
|
|
|
|
+ snprintf(repo, len, "(%s: %s on %p)", type, name, ap[0].value->value);
|
|
setResultOperationBase(result, makeLinkValue(makeStringValue(repo, inter), belong, inter));
|
|
setResultOperationBase(result, makeLinkValue(makeStringValue(repo, inter), belong, inter));
|
|
|
|
+ memFree(repo);
|
|
return result->type;
|
|
return result->type;
|
|
}
|
|
}
|
|
|
|
|
|
void registeredObject(REGISTERED_FUNCTIONSIG){
|
|
void registeredObject(REGISTERED_FUNCTIONSIG){
|
|
LinkValue *object = makeLinkValue(inter->data.object, inter->base_father, inter);
|
|
LinkValue *object = makeLinkValue(inter->data.object, inter->base_father, inter);
|
|
NameFunc tmp[] = {{inter->data.object_new, object_new_, class_free_},
|
|
NameFunc tmp[] = {{inter->data.object_new, object_new_, class_free_},
|
|
- {inter->data.object_repo, object_repo_, object_free_},
|
|
|
|
|
|
+ {inter->data.object_repo, object_repo_, all_free_},
|
|
{NULL, NULL}};
|
|
{NULL, NULL}};
|
|
gc_addTmpLink(&object->gc_status);
|
|
gc_addTmpLink(&object->gc_status);
|
|
addStrVar("object", false, true, object, belong, CALL_INTER_FUNCTIONSIG_CORE(inter->var_list));
|
|
addStrVar("object", false, true, object, belong, CALL_INTER_FUNCTIONSIG_CORE(inter->var_list));
|