Lines Matching refs:type

30     type_T *type;  in get_type_ptr()  local
34 type = ALLOC_CLEAR_ONE(type_T); in get_type_ptr()
35 if (type != NULL) in get_type_ptr()
37 ((type_T **)type_gap->ga_data)[type_gap->ga_len] = type; in get_type_ptr()
40 return type; in get_type_ptr()
56 alloc_type(type_T *type) in alloc_type() argument
60 if (type == NULL) in alloc_type()
64 if (type->tt_flags & TTFLAG_STATIC) in alloc_type()
65 return type; in alloc_type()
68 *ret = *type; in alloc_type()
72 if (type->tt_args != NULL) in alloc_type()
76 ret->tt_args = ALLOC_MULT(type_T *, type->tt_argcount); in alloc_type()
78 for (i = 0; i < type->tt_argcount; ++i) in alloc_type()
79 ret->tt_args[i] = alloc_type(type->tt_args[i]); in alloc_type()
89 free_type(type_T *type) in free_type() argument
93 if (type == NULL || (type->tt_flags & TTFLAG_STATIC)) in free_type()
95 if (type->tt_args != NULL) in free_type()
97 for (i = 0; i < type->tt_argcount; ++i) in free_type()
98 free_type(type->tt_args[i]); in free_type()
99 vim_free(type->tt_args); in free_type()
101 free_type(type->tt_member); in free_type()
102 vim_free(type); in free_type()
108 type_T *type; in get_list_type() local
124 type = get_type_ptr(type_gap); in get_list_type()
125 if (type == NULL) in get_list_type()
127 type->tt_type = VAR_LIST; in get_list_type()
128 type->tt_member = member_type; in get_list_type()
129 type->tt_argcount = 0; in get_list_type()
130 type->tt_args = NULL; in get_list_type()
131 return type; in get_list_type()
137 type_T *type; in get_dict_type() local
153 type = get_type_ptr(type_gap); in get_dict_type()
154 if (type == NULL) in get_dict_type()
156 type->tt_type = VAR_DICT; in get_dict_type()
157 type->tt_member = member_type; in get_dict_type()
158 type->tt_argcount = 0; in get_dict_type()
159 type->tt_args = NULL; in get_dict_type()
160 return type; in get_dict_type()
169 type_T *type = get_type_ptr(type_gap); in alloc_func_type() local
171 if (type == NULL) in alloc_func_type()
173 type->tt_type = VAR_FUNC; in alloc_func_type()
174 type->tt_member = ret_type == NULL ? &t_unknown : ret_type; in alloc_func_type()
175 type->tt_argcount = argcount; in alloc_func_type()
176 type->tt_args = NULL; in alloc_func_type()
177 return type; in alloc_func_type()
260 type_T *type; in typval2type_int() local
368 type = get_type_ptr(type_gap); in typval2type_int()
369 if (type == NULL) in typval2type_int()
371 *type = *ufunc->uf_func_type; in typval2type_int()
372 type->tt_argcount -= tv->vval.v_partial->pt_argc; in typval2type_int()
373 type->tt_min_argcount -= tv->vval.v_partial->pt_argc; in typval2type_int()
374 return type; in typval2type_int()
381 type = get_type_ptr(type_gap); in typval2type_int()
382 if (type == NULL) in typval2type_int()
384 type->tt_type = tv->v_type; in typval2type_int()
385 type->tt_argcount = argcount; in typval2type_int()
386 type->tt_min_argcount = min_argcount; in typval2type_int()
390 type->tt_argcount -= tv->vval.v_partial->pt_argc; in typval2type_int()
391 type->tt_min_argcount -= tv->vval.v_partial->pt_argc; in typval2type_int()
393 type->tt_member = member_type; in typval2type_int()
395 return type; in typval2type_int()
402 need_convert_to_bool(type_T *type, typval_T *tv) in need_convert_to_bool() argument
404 return type != NULL && type == &t_bool && tv->v_type != VAR_BOOL in need_convert_to_bool()
417 type_T *type = typval2type_int(tv, copyID, type_gap, do_member); in typval2type() local
419 if (type != NULL && type != &t_bool in typval2type()
424 type = &t_number_bool; in typval2type()
425 return type; in typval2type()
609 type_T *type, in check_argument_types() argument
614 int varargs = (type->tt_flags & TTFLAG_VARARGS) ? 1 : 0; in check_argument_types()
617 if (type->tt_type != VAR_FUNC && type->tt_type != VAR_PARTIAL) in check_argument_types()
619 if (argcount < type->tt_min_argcount - varargs) in check_argument_types()
624 if (!varargs && type->tt_argcount >= 0 && argcount > type->tt_argcount) in check_argument_types()
629 if (type->tt_args == NULL) in check_argument_types()
637 if (varargs && i >= type->tt_argcount - 1) in check_argument_types()
638 expected = type->tt_args[type->tt_argcount - 1]->tt_member; in check_argument_types()
640 expected = type->tt_args[i]; in check_argument_types()
715 type_T *type, in parse_type_member() argument
748 if (type->tt_type == VAR_LIST) in parse_type_member()
819 type_T *type; in parse_type() local
856 type = parse_type(&p, type_gap, give_error); in parse_type()
857 if (type == NULL) in parse_type()
859 arg_type[argcount++] = type; in parse_type()
914 type = get_func_type(ret_type, argcount, type_gap); in parse_type()
917 type = alloc_func_type(ret_type, argcount, type_gap); in parse_type()
918 type->tt_flags = flags; in parse_type()
921 type->tt_argcount = argcount; in parse_type()
922 type->tt_min_argcount = first_optional == -1 in parse_type()
924 if (func_type_add_arg_types(type, argcount, in parse_type()
927 mch_memmove(type->tt_args, arg_type, in parse_type()
931 return type; in parse_type()
1119 type_T *type; in get_member_type_from_stack() local
1132 type = *(stack_top -((count - i) * skip) + skip - 1); in get_member_type_from_stack()
1133 common_type(type, result, &result, type_gap); in get_member_type_from_stack()
1140 vartype_name(vartype_T type) in vartype_name() argument
1142 switch (type) in vartype_name()
1170 type_name(type_T *type, char **tofree) in type_name() argument
1175 if (type == NULL) in type_name()
1177 name = vartype_name(type->tt_type); in type_name()
1178 if (type->tt_type == VAR_LIST || type->tt_type == VAR_DICT) in type_name()
1181 char *member_name = type_name(type->tt_member, &member_free); in type_name()
1193 if (type->tt_type == VAR_FUNC) in type_name()
1197 int varargs = (type->tt_flags & TTFLAG_VARARGS) ? 1 : 0; in type_name()
1205 for (i = 0; i < type->tt_argcount; ++i) in type_name()
1211 if (type->tt_args == NULL) in type_name()
1214 arg_type = type_name(type->tt_args[i], &arg_free); in type_name()
1227 if (varargs && i == type->tt_argcount - 1) in type_name()
1229 else if (i >= type->tt_min_argcount) in type_name()
1234 if (type->tt_argcount < 0) in type_name()
1238 if (type->tt_member == &t_void) in type_name()
1243 char *ret_name = type_name(type->tt_member, &ret_free); in type_name()
1271 type_T *type; in f_typename() local
1277 type = typval2type(argvars, get_copyID(), &type_list, TRUE); in f_typename()
1278 name = type_name(type, &tofree); in f_typename()