0
0
mirror of https://github.com/vim/vim.git synced 2025-10-02 05:04:20 -04:00

patch 8.2.1430: Vim9: error for missing comma instead of extra white space

Problem:    Vim9: error for missing comma instead of extra white space.
Solution:   Check if comma can be found after white space. (closes #6668)
            Also check for extra white space in literal dict. (closes #6670)
This commit is contained in:
Bram Moolenaar
2020-08-12 18:01:53 +02:00
parent 17a836cbee
commit db199216e8
5 changed files with 41 additions and 3 deletions

View File

@@ -1383,7 +1383,10 @@ def Test_expr7_list()
call CheckDefExecFailure(["let x = g:anint[3]"], 'E714:')
call CheckDefFailure(["let x = g:list_mixed[xxx]"], 'E1001:')
call CheckDefFailure(["let x = [1,2,3]"], 'E1069:')
call CheckDefFailure(["let x = [1 ,2, 3]"], 'E1068:')
call CheckDefExecFailure(["let x = g:list_mixed['xx']"], 'E1029:')
call CheckDefFailure(["let x = g:list_mixed["], 'E1097:')
call CheckDefFailure(["let x = g:list_mixed[0"], 'E1097:')
@@ -1422,6 +1425,12 @@ def Test_expr7_list_vim9script()
let l = [11,22]
END
CheckScriptFailure(lines, 'E1069:')
lines =<< trim END
vim9script
let l = [11 , 22]
END
CheckScriptFailure(lines, 'E1068:')
enddef
def Test_expr7_lambda()
@@ -1556,6 +1565,18 @@ def Test_expr7_dict_vim9script()
let d = #{one: 1,two: 2}
END
CheckScriptFailure(lines, 'E1069:')
lines =<< trim END
vim9script
let d = #{one : 1}
END
CheckScriptFailure(lines, 'E1068:')
lines =<< trim END
vim9script
let d = #{one:1}
END
CheckScriptFailure(lines, 'E1069:')
enddef
let g:oneString = 'one'