0
0
mirror of https://github.com/vim/vim.git synced 2025-09-30 04:44:14 -04:00

patch 8.2.1268: Vim9: no error for using double quote comment

Problem:    Vim9: no error for using double quote comment after :func or :def.
Solution:   Only accept double quote when not in Vim9 script and not after
            :def. (closes #6483)
This commit is contained in:
Bram Moolenaar
2020-07-22 18:17:08 +02:00
parent 2690b5aed8
commit e7e4838f25
3 changed files with 40 additions and 4 deletions

View File

@@ -2198,6 +2198,35 @@ def Test_vim9_comment()
'vim9script',
'call execute("ls")# comment',
], 'E488:')
CheckScriptFailure([
'def Test() " comment',
'enddef',
], 'E488:')
CheckScriptFailure([
'vim9script',
'def Test() " comment',
'enddef',
], 'E488:')
CheckScriptSuccess([
'func Test() " comment',
'endfunc',
])
CheckScriptFailure([
'vim9script',
'func Test() " comment',
'endfunc',
], 'E488:')
CheckScriptSuccess([
'def Test() # comment',
'enddef',
])
CheckScriptFailure([
'func Test() # comment',
'endfunc',
], 'E488:')
enddef
def Test_vim9_comment_gui()