1
0
forked from aniani/vim

patch 8.2.2315: Vim9: "enddef" as dict key misintepreted as function end

Problem:    Vim9: "enddef" as dict key misintepreted as function end.
Solution:   Check for following colon. (closes #7640)
This commit is contained in:
Bram Moolenaar
2021-01-08 21:55:26 +01:00
parent 299f3036ec
commit 832ea89ca9
3 changed files with 14 additions and 2 deletions

View File

@@ -116,6 +116,14 @@ def Test_missing_endfunc_enddef()
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