1
0
forked from aniani/vim

patch 9.1.0367: compile_def_function is too long

Problem:  compile_def_function is too long
Solution: Move out the code to compile the body of a function
          (Yegappan Lakshmanan)

closes: #14622

Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
Yegappan Lakshmanan 2024-04-23 20:14:46 +02:00 committed by Christian Brabandt
parent ea999037a4
commit a16f251333
No known key found for this signature in database
GPG Key ID: F3F92DA383FDDE09
4 changed files with 575 additions and 557 deletions

View File

@ -4785,6 +4785,8 @@ def Test_typename()
endif
assert_equal('class<Unknown>', typename(null_class))
assert_equal('object<Unknown>', typename(null_object))
var l: list<func(list<number>): number> = [function('min')]
assert_equal('list<func(list<number>): number>', typename(l))
enddef
def Test_undofile()

View File

@ -704,6 +704,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
367,
/**/
366,
/**/

File diff suppressed because it is too large Load Diff

View File

@ -1894,14 +1894,12 @@ type_name_list_or_dict(char *name, type_T *type, char **tofree)
size_t len = STRLEN(name) + STRLEN(member_name) + 3;
*tofree = alloc(len);
if (*tofree != NULL)
{
vim_snprintf(*tofree, len, "%s<%s>", name, member_name);
vim_free(member_free);
return *tofree;
}
if (*tofree == NULL)
return name;
return name;
vim_snprintf(*tofree, len, "%s<%s>", name, member_name);
vim_free(member_free);
return *tofree;
}
/*
@ -1924,17 +1922,15 @@ type_name_class_or_obj(char *name, type_T *type, char **tofree)
size_t len = STRLEN(name) + STRLEN(class_name) + 3;
*tofree = alloc(len);
if (*tofree != NULL)
{
vim_snprintf(*tofree, len, "%s<%s>", name, class_name);
return *tofree;
}
if (*tofree == NULL)
return name;
return name;
vim_snprintf(*tofree, len, "%s<%s>", name, class_name);
return *tofree;
}
/*
* Return the type name of a functio.
* Return the type name of a function.
* The result may be in allocated memory, in which case "tofree" is set.
*/
static char *