CheckScriptFailure(lines, 'E126:', 2)
enddef
+def Test_enddef_dict_key()
+ var d = {
+ enddef: 'x',
+ endfunc: 'y',
+ }
+ assert_equal({enddef: 'x', endfunc: 'y'}, d)
+enddef
+
def ReturnString(): string
return 'string'
enddef
;
// Check for "endfunction" or "enddef".
+ // When a ":" follows it must be a dict key; "enddef: value,"
if (checkforcmd(&p, nesting_def[nesting]
- ? "enddef" : "endfunction", 4))
+ ? "enddef" : "endfunction", 4)
+ && *p != ':')
{
if (nesting-- == 0)
{
// not find it.
else if (nesting_def[nesting])
{
- if (checkforcmd(&p, "endfunction", 4))
+ if (checkforcmd(&p, "endfunction", 4) && *p != ':')
emsg(_(e_mismatched_endfunction));
}
else if (eap->cmdidx == CMD_def && checkforcmd(&p, "enddef", 4))