1
0
forked from aniani/vim

patch 8.2.2264: Vim9: no error for mismatched :endfunc or :enddef

Problem:    Vim9: no error for mismatched :endfunc or :enddef.
Solution:   Check for the mismatch. (issue #7582)
This commit is contained in:
Bram Moolenaar
2021-01-01 18:43:51 +01:00
parent 69f7050ceb
commit 5178b1b02f
4 changed files with 63 additions and 22 deletions

View File

@@ -79,6 +79,25 @@ def Test_funcdepth_error()
set maxfuncdepth&
enddef
def Test_endfunc_enddef()
var lines =<< trim END
def Test()
echo 'test'
endfunc
enddef
END
CheckScriptFailure(lines, 'E1151:', 3)
lines =<< trim END
def Test()
func Nested()
echo 'test'
enddef
enddef
END
CheckScriptFailure(lines, 'E1152:', 4)
enddef
def ReturnString(): string
return 'string'
enddef