|
@@ -12,7 +12,7 @@ ResultType tuple_list_newCore(OFFICAL_FUNCTIONSIG, enum ListType type){
|
|
|
freeResult(result);
|
|
|
|
|
|
value = make_new(inter, belong, ap[0].value);
|
|
|
- value->value->type = list;
|
|
|
+ value->value->type = V_list;
|
|
|
value->value->data.list.type = type;
|
|
|
value->value->data.list.list = NULL;
|
|
|
value->value->data.list.size = 0;
|
|
@@ -23,7 +23,7 @@ ResultType tuple_list_newCore(OFFICAL_FUNCTIONSIG, enum ListType type){
|
|
|
value->value->data.list.list[value->value->data.list.size - 1] = at->data.value;
|
|
|
}
|
|
|
|
|
|
- switch (init_new(value, NULL, "list.new", CALL_INTER_FUNCTIONSIG_NOT_ST(var_list, result, belong))) {
|
|
|
+ switch (init_new(value, NULL, "V_list.new", CALL_INTER_FUNCTIONSIG_NOT_ST(var_list, result, belong))) {
|
|
|
case 1:
|
|
|
freeResult(result);
|
|
|
setResultOperation(result, value);
|
|
@@ -35,11 +35,11 @@ ResultType tuple_list_newCore(OFFICAL_FUNCTIONSIG, enum ListType type){
|
|
|
}
|
|
|
|
|
|
ResultType tuple_new(OFFICAL_FUNCTIONSIG) {
|
|
|
- return tuple_list_newCore(CALL_OFFICAL_FUNCTION(arg, var_list, result, belong), value_tuple);
|
|
|
+ return tuple_list_newCore(CALL_OFFICAL_FUNCTION(arg, var_list, result, belong), L_tuple);
|
|
|
}
|
|
|
|
|
|
ResultType list_new(OFFICAL_FUNCTIONSIG) {
|
|
|
- return tuple_list_newCore(CALL_OFFICAL_FUNCTION(arg, var_list, result, belong), value_list);
|
|
|
+ return tuple_list_newCore(CALL_OFFICAL_FUNCTION(arg, var_list, result, belong), L_list);
|
|
|
}
|
|
|
|
|
|
ResultType list_slice(OFFICAL_FUNCTIONSIG){
|
|
@@ -58,8 +58,8 @@ ResultType list_slice(OFFICAL_FUNCTIONSIG){
|
|
|
return result->type;
|
|
|
freeResult(result);
|
|
|
|
|
|
- if (ap[0].value->value->type != list) {
|
|
|
- setResultError(E_TypeException, INSTANCE_ERROR(list), 0, "list", true, CALL_INTER_FUNCTIONSIG_NOT_ST(var_list, result, belong));
|
|
|
+ if (ap[0].value->value->type != V_list) {
|
|
|
+ setResultError(E_TypeException, INSTANCE_ERROR(V_list), 0, "V_list", true, CALL_INTER_FUNCTIONSIG_NOT_ST(var_list, result, belong));
|
|
|
return R_error;
|
|
|
}
|
|
|
size = ap[0].value->value->data.list.size;
|
|
@@ -68,10 +68,10 @@ ResultType list_slice(OFFICAL_FUNCTIONSIG){
|
|
|
second = size;
|
|
|
stride = 1;
|
|
|
for (vnum *list[]={&first, &second, &stride}, i=0; i < 3; i++) {
|
|
|
- if (ap[i + 1].value != NULL && ap[i + 1].value->value->type == number)
|
|
|
+ if (ap[i + 1].value != NULL && ap[i + 1].value->value->type == V_num)
|
|
|
*(list[i]) = ap[i + 1].value->value->data.num.num;
|
|
|
- else if (ap[i + 1].value != NULL && ap[i + 1].value->value->type != none) {
|
|
|
- setResultError(E_TypeException, ONLY_ACC(first/second/stride, number or none), 0, "list", true, CALL_INTER_FUNCTIONSIG_NOT_ST(var_list, result, belong));
|
|
|
+ else if (ap[i + 1].value != NULL && ap[i + 1].value->value->type != V_none) {
|
|
|
+ setResultError(E_TypeException, ONLY_ACC(first/second/stride, V_num or V_none), 0, "V_list", true, CALL_INTER_FUNCTIONSIG_NOT_ST(var_list, result, belong));
|
|
|
return R_error;
|
|
|
}
|
|
|
}
|
|
@@ -85,7 +85,7 @@ ResultType list_slice(OFFICAL_FUNCTIONSIG){
|
|
|
LinkValue *element = ap[0].value->value->data.list.list[i];
|
|
|
new_list = connectValueArgument(element, new_list);
|
|
|
}
|
|
|
- makeListValue(new_list, 0, "list.slice", value_list, CALL_INTER_FUNCTIONSIG_NOT_ST(var_list, result, belong));
|
|
|
+ makeListValue(new_list, 0, "V_list.slice", L_list, CALL_INTER_FUNCTIONSIG_NOT_ST(var_list, result, belong));
|
|
|
freeArgument(new_list, true);
|
|
|
}
|
|
|
return result->type;
|
|
@@ -109,12 +109,12 @@ ResultType list_slice_assignment(OFFICAL_FUNCTIONSIG){
|
|
|
return result->type;
|
|
|
freeResult(result);
|
|
|
|
|
|
- if (ap[0].value->value->type != list) {
|
|
|
- setResultError(E_TypeException, INSTANCE_ERROR(list), 0, "sys", true, CALL_INTER_FUNCTIONSIG_NOT_ST(var_list, result, belong));
|
|
|
+ if (ap[0].value->value->type != V_list) {
|
|
|
+ setResultError(E_TypeException, INSTANCE_ERROR(V_list), 0, "sys", true, CALL_INTER_FUNCTIONSIG_NOT_ST(var_list, result, belong));
|
|
|
return R_error;
|
|
|
}
|
|
|
size = ap[0].value->value->data.list.size;
|
|
|
- getIter(ap[1].value, 1, 0, "list", CALL_INTER_FUNCTIONSIG_NOT_ST(var_list, result, belong));
|
|
|
+ getIter(ap[1].value, 1, 0, "V_list", CALL_INTER_FUNCTIONSIG_NOT_ST(var_list, result, belong));
|
|
|
if (!CHECK_RESULT(result))
|
|
|
return result->type;
|
|
|
iter_obj = result->value;
|
|
@@ -125,10 +125,10 @@ ResultType list_slice_assignment(OFFICAL_FUNCTIONSIG){
|
|
|
second = size;
|
|
|
stride = 1;
|
|
|
for (vnum *list[]={&first, &second, &stride}, i=0; i < 3; i++) {
|
|
|
- if (ap[i + 2].value != NULL && ap[i + 2].value->value->type == number)
|
|
|
+ if (ap[i + 2].value != NULL && ap[i + 2].value->value->type == V_num)
|
|
|
*(list[i]) = ap[i + 2].value->value->data.num.num;
|
|
|
- else if (ap[i + 2].value != NULL && ap[i + 2].value->value->type != none) {
|
|
|
- setResultError(E_TypeException, ONLY_ACC(first/second/stride, num or null), 0, "list", true, CALL_INTER_FUNCTIONSIG_NOT_ST(var_list, result, belong));
|
|
|
+ else if (ap[i + 2].value != NULL && ap[i + 2].value->value->type != V_none) {
|
|
|
+ setResultError(E_TypeException, ONLY_ACC(first/second/stride, num or null), 0, "V_list", true, CALL_INTER_FUNCTIONSIG_NOT_ST(var_list, result, belong));
|
|
|
goto return_;
|
|
|
}
|
|
|
}
|
|
@@ -139,9 +139,9 @@ ResultType list_slice_assignment(OFFICAL_FUNCTIONSIG){
|
|
|
{
|
|
|
for (vnum i = stride > 0 ? first : second; stride > 0 ? (i < second) : (i > first); i += stride) {
|
|
|
freeResult(result);
|
|
|
- getIter(iter_obj, 0, 0, "list", CALL_INTER_FUNCTIONSIG_NOT_ST(var_list, result, belong));
|
|
|
+ getIter(iter_obj, 0, 0, "V_list", CALL_INTER_FUNCTIONSIG_NOT_ST(var_list, result, belong));
|
|
|
if (is_iterStop(result->value, inter)){
|
|
|
- setResultError(E_TypeException, L"Iter Object Too Short", 0, "list", true, CALL_INTER_FUNCTIONSIG_NOT_ST(var_list, result, belong));
|
|
|
+ setResultError(E_TypeException, L"Iter Object Too Short", 0, "V_list", true, CALL_INTER_FUNCTIONSIG_NOT_ST(var_list, result, belong));
|
|
|
goto return_;
|
|
|
}
|
|
|
else if (!CHECK_RESULT(result))
|
|
@@ -149,9 +149,9 @@ ResultType list_slice_assignment(OFFICAL_FUNCTIONSIG){
|
|
|
ap[0].value->value->data.list.list[i] = result->value;
|
|
|
}
|
|
|
freeResult(result);
|
|
|
- getIter(iter_obj, 0, 0, "list", CALL_INTER_FUNCTIONSIG_NOT_ST(var_list, result, belong));
|
|
|
+ getIter(iter_obj, 0, 0, "V_list", CALL_INTER_FUNCTIONSIG_NOT_ST(var_list, result, belong));
|
|
|
if (CHECK_RESULT(result)) {
|
|
|
- setResultError(E_TypeException, L"Iter Object Too Long", 0, "list", true, CALL_INTER_FUNCTIONSIG_NOT_ST(var_list, result, belong));
|
|
|
+ setResultError(E_TypeException, L"Iter Object Too Long", 0, "V_list", true, CALL_INTER_FUNCTIONSIG_NOT_ST(var_list, result, belong));
|
|
|
goto return_;
|
|
|
} else if (!is_iterStop(result->value, inter))
|
|
|
goto return_;
|
|
@@ -178,8 +178,8 @@ ResultType list_slice_del(OFFICAL_FUNCTIONSIG){
|
|
|
return result->type;
|
|
|
freeResult(result);
|
|
|
|
|
|
- if (ap[0].value->value->type != list) {
|
|
|
- setResultError(E_TypeException, INSTANCE_ERROR(list), 0, "list", true, CALL_INTER_FUNCTIONSIG_NOT_ST(var_list, result, belong));
|
|
|
+ if (ap[0].value->value->type != V_list) {
|
|
|
+ setResultError(E_TypeException, INSTANCE_ERROR(V_list), 0, "V_list", true, CALL_INTER_FUNCTIONSIG_NOT_ST(var_list, result, belong));
|
|
|
return R_error;
|
|
|
}
|
|
|
size = ap[0].value->value->data.list.size;
|
|
@@ -188,10 +188,10 @@ ResultType list_slice_del(OFFICAL_FUNCTIONSIG){
|
|
|
second = size;
|
|
|
stride = 1;
|
|
|
for (vnum *list[]={&first, &second, &stride}, i=0; i < 3; i++) {
|
|
|
- if (ap[i + 1].value != NULL && ap[i + 1].value->value->type == number)
|
|
|
+ if (ap[i + 1].value != NULL && ap[i + 1].value->value->type == V_num)
|
|
|
*(list[i]) = ap[i + 1].value->value->data.num.num;
|
|
|
- else if (ap[i + 1].value != NULL && ap[i + 1].value->value->type != none) {
|
|
|
- setResultError(E_TypeException, ONLY_ACC(first/second/stride, num or null), 0, "list", true, CALL_INTER_FUNCTIONSIG_NOT_ST(var_list, result, belong));
|
|
|
+ else if (ap[i + 1].value != NULL && ap[i + 1].value->value->type != V_none) {
|
|
|
+ setResultError(E_TypeException, ONLY_ACC(first/second/stride, num or null), 0, "V_list", true, CALL_INTER_FUNCTIONSIG_NOT_ST(var_list, result, belong));
|
|
|
return R_error;
|
|
|
}
|
|
|
}
|
|
@@ -233,12 +233,12 @@ ResultType list_down_assignment(OFFICAL_FUNCTIONSIG){
|
|
|
return result->type;
|
|
|
freeResult(result);
|
|
|
|
|
|
- if (ap[0].value->value->type != list){
|
|
|
- setResultError(E_TypeException, INSTANCE_ERROR(list), 0, "list", true, CALL_INTER_FUNCTIONSIG_NOT_ST(var_list, result, belong));
|
|
|
+ if (ap[0].value->value->type != V_list){
|
|
|
+ setResultError(E_TypeException, INSTANCE_ERROR(V_list), 0, "V_list", true, CALL_INTER_FUNCTIONSIG_NOT_ST(var_list, result, belong));
|
|
|
return R_error;
|
|
|
}
|
|
|
- if (ap[2].value->value->type != number){
|
|
|
- setResultError(E_TypeException, ONLY_ACC(list index, number), 0, "list", true, CALL_INTER_FUNCTIONSIG_NOT_ST(var_list, result, belong));
|
|
|
+ if (ap[2].value->value->type != V_num){
|
|
|
+ setResultError(E_TypeException, ONLY_ACC(V_list index, V_num), 0, "V_list", true, CALL_INTER_FUNCTIONSIG_NOT_ST(var_list, result, belong));
|
|
|
return R_error;
|
|
|
}
|
|
|
|
|
@@ -247,10 +247,10 @@ ResultType list_down_assignment(OFFICAL_FUNCTIONSIG){
|
|
|
if (index < 0)
|
|
|
index = size + index;
|
|
|
if (index >= size){
|
|
|
- setResultError(E_IndexException, L"Index too max", 0, "list", true, CALL_INTER_FUNCTIONSIG_NOT_ST(var_list, result, belong));
|
|
|
+ setResultError(E_IndexException, L"Index too max", 0, "V_list", true, CALL_INTER_FUNCTIONSIG_NOT_ST(var_list, result, belong));
|
|
|
return R_error;
|
|
|
} else if (index < 0){
|
|
|
- setResultError(E_IndexException, L"Index less than 0", 0, "list", true, CALL_INTER_FUNCTIONSIG_NOT_ST(var_list, result, belong));
|
|
|
+ setResultError(E_IndexException, L"Index less than 0", 0, "V_list", true, CALL_INTER_FUNCTIONSIG_NOT_ST(var_list, result, belong));
|
|
|
return R_error;
|
|
|
}
|
|
|
ap[0].value->value->data.list.list[index] = ap[1].value;
|
|
@@ -270,12 +270,12 @@ ResultType list_down_del(OFFICAL_FUNCTIONSIG){
|
|
|
return result->type;
|
|
|
freeResult(result);
|
|
|
|
|
|
- if (ap[0].value->value->type != list){
|
|
|
- setResultError(E_TypeException, INSTANCE_ERROR(list), 0, "list", true, CALL_INTER_FUNCTIONSIG_NOT_ST(var_list, result, belong));
|
|
|
+ if (ap[0].value->value->type != V_list){
|
|
|
+ setResultError(E_TypeException, INSTANCE_ERROR(V_list), 0, "V_list", true, CALL_INTER_FUNCTIONSIG_NOT_ST(var_list, result, belong));
|
|
|
return R_error;
|
|
|
}
|
|
|
- if (ap[1].value->value->type != number){
|
|
|
- setResultError(E_TypeException, ONLY_ACC(list index, number), 0, "list", true, CALL_INTER_FUNCTIONSIG_NOT_ST(var_list, result, belong));
|
|
|
+ if (ap[1].value->value->type != V_num){
|
|
|
+ setResultError(E_TypeException, ONLY_ACC(V_list index, V_num), 0, "V_list", true, CALL_INTER_FUNCTIONSIG_NOT_ST(var_list, result, belong));
|
|
|
return R_error;
|
|
|
}
|
|
|
|
|
@@ -309,12 +309,12 @@ ResultType list_down(OFFICAL_FUNCTIONSIG){
|
|
|
return result->type;
|
|
|
freeResult(result);
|
|
|
|
|
|
- if (ap[0].value->value->type != list){
|
|
|
- setResultError(E_TypeException, INSTANCE_ERROR(list), 0, "list", true, CALL_INTER_FUNCTIONSIG_NOT_ST(var_list, result, belong));
|
|
|
+ if (ap[0].value->value->type != V_list){
|
|
|
+ setResultError(E_TypeException, INSTANCE_ERROR(V_list), 0, "V_list", true, CALL_INTER_FUNCTIONSIG_NOT_ST(var_list, result, belong));
|
|
|
return R_error;
|
|
|
}
|
|
|
- if (ap[1].value->value->type != number){
|
|
|
- setResultError(E_TypeException, ONLY_ACC(list index, number), 0, "list", true, CALL_INTER_FUNCTIONSIG_NOT_ST(var_list, result, belong));
|
|
|
+ if (ap[1].value->value->type != V_num){
|
|
|
+ setResultError(E_TypeException, ONLY_ACC(V_list index, V_num), 0, "V_list", true, CALL_INTER_FUNCTIONSIG_NOT_ST(var_list, result, belong));
|
|
|
return R_error;
|
|
|
}
|
|
|
|
|
@@ -336,13 +336,13 @@ ResultType list_iter(OFFICAL_FUNCTIONSIG){
|
|
|
return result->type;
|
|
|
freeResult(result);
|
|
|
|
|
|
- if (ap[0].value->value->type != list){
|
|
|
- setResultError(E_TypeException, INSTANCE_ERROR(list), 0, "list", true, CALL_INTER_FUNCTIONSIG_NOT_ST(var_list, result, belong));
|
|
|
+ if (ap[0].value->value->type != V_list){
|
|
|
+ setResultError(E_TypeException, INSTANCE_ERROR(V_list), 0, "V_list", true, CALL_INTER_FUNCTIONSIG_NOT_ST(var_list, result, belong));
|
|
|
return R_error;
|
|
|
}
|
|
|
{
|
|
|
Argument *list_iter_arg = makeValueArgument(ap[0].value);
|
|
|
- callBackCore(inter->data.list_iter, list_iter_arg, 0, "list", 0,
|
|
|
+ callBackCore(inter->data.list_iter, list_iter_arg, 0, "V_list", 0,
|
|
|
CALL_INTER_FUNCTIONSIG_NOT_ST(var_list, result, belong));
|
|
|
freeArgument(list_iter_arg, true);
|
|
|
}
|
|
@@ -363,8 +363,8 @@ ResultType listRepoStrCore(OFFICAL_FUNCTIONSIG, bool is_repo){
|
|
|
freeResult(result);
|
|
|
value = ap[0].value->value;
|
|
|
|
|
|
- if (value->type != list){
|
|
|
- setResultError(E_TypeException, INSTANCE_ERROR(list), 0, "sys", true, CALL_INTER_FUNCTIONSIG_NOT_ST(var_list, result, belong));
|
|
|
+ if (value->type != V_list){
|
|
|
+ setResultError(E_TypeException, INSTANCE_ERROR(V_list), 0, "sys", true, CALL_INTER_FUNCTIONSIG_NOT_ST(var_list, result, belong));
|
|
|
return R_error;
|
|
|
}
|
|
|
lt = value->data.list.type;
|
|
@@ -374,13 +374,13 @@ ResultType listRepoStrCore(OFFICAL_FUNCTIONSIG, bool is_repo){
|
|
|
if (!CHECK_RESULT(result))
|
|
|
return result->type;
|
|
|
if (again_) {
|
|
|
- makeStringValue((lt == value_list ? L"[...]" : L"(...)"), 0, "list.repo", CALL_INTER_FUNCTIONSIG_NOT_ST(var_list, result, belong));
|
|
|
+ makeStringValue((lt == L_list ? L"[...]" : L"(...)"), 0, "V_list.repo", CALL_INTER_FUNCTIONSIG_NOT_ST(var_list, result, belong));
|
|
|
return result->type;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- setBoolAttrible(true, is_repo ? L"repo_again" : L"str_again", 0, "list.repo", ap[0].value, CALL_INTER_FUNCTIONSIG_NOT_ST(var_list, result, belong));
|
|
|
- if (lt == value_list)
|
|
|
+ setBoolAttrible(true, is_repo ? L"repo_again" : L"str_again", 0, "V_list.repo", ap[0].value, CALL_INTER_FUNCTIONSIG_NOT_ST(var_list, result, belong));
|
|
|
+ if (lt == L_list)
|
|
|
repo = memWidecpy(L"[");
|
|
|
else
|
|
|
repo = memWidecpy(L"(");
|
|
@@ -394,18 +394,18 @@ ResultType listRepoStrCore(OFFICAL_FUNCTIONSIG, bool is_repo){
|
|
|
goto return_;
|
|
|
repo = memWidecat(repo, tmp, true, false);
|
|
|
}
|
|
|
- if (lt == value_list)
|
|
|
+ if (lt == L_list)
|
|
|
repo = memWidecat(repo, L"]", true, false);
|
|
|
else
|
|
|
repo = memWidecat(repo, L")", true, false);
|
|
|
|
|
|
freeResult(result);
|
|
|
- makeStringValue(repo, 0, "list.repo", CALL_INTER_FUNCTIONSIG_NOT_ST(var_list, result, belong));
|
|
|
+ makeStringValue(repo, 0, "V_list.repo", CALL_INTER_FUNCTIONSIG_NOT_ST(var_list, result, belong));
|
|
|
return_:
|
|
|
{
|
|
|
Result tmp;
|
|
|
setResultCore(&tmp);
|
|
|
- setBoolAttrible(false, is_repo ? L"repo_again" : L"str_again", 0, "list.repo", ap[0].value, CALL_INTER_FUNCTIONSIG_NOT_ST(var_list, &tmp, belong));
|
|
|
+ setBoolAttrible(false, is_repo ? L"repo_again" : L"str_again", 0, "V_list.repo", ap[0].value, CALL_INTER_FUNCTIONSIG_NOT_ST(var_list, &tmp, belong));
|
|
|
if (!RUN_TYPE(tmp.type)) {
|
|
|
freeResult(result);
|
|
|
*result = tmp;
|
|
@@ -449,7 +449,7 @@ void registeredList(REGISTERED_FUNCTIONSIG){
|
|
|
{inter->data.object_slice_assignment, list_slice_assignment, object_free_},
|
|
|
{NULL, NULL}};
|
|
|
gc_addTmpLink(&object->gc_status);
|
|
|
- addBaseClassVar(L"list", object, belong, inter);
|
|
|
+ addBaseClassVar(L"V_list", object, belong, inter);
|
|
|
iterBaseClassFunc(tmp, object, CALL_INTER_FUNCTIONSIG_CORE(inter->var_list));
|
|
|
gc_freeTmpLink(&object->gc_status);
|
|
|
}
|