mirror of
https://github.com/vim/vim.git
synced 2025-10-03 05:14:07 -04:00
patch 8.2.2090: Vim9: dict does not accept a key in quotes
Problem: Vim9: dict does not accept a key in quotes. Solution: Recognize a key in single or double quotes.
This commit is contained in:
@@ -1930,12 +1930,13 @@ def Test_expr7_dict()
|
||||
|
||||
assert_equal(g:test_space_dict, {['']: 'empty', [' ']: 'space'})
|
||||
assert_equal(g:test_hash_dict, {one: 1, two: 2})
|
||||
|
||||
assert_equal({['a a']: 1, ['b/c']: 2}, {'a a': 1, "b/c": 2})
|
||||
END
|
||||
CheckDefAndScriptSuccess(lines)
|
||||
|
||||
# legacy syntax doesn't work
|
||||
CheckDefFailure(["var x = #{key: 8}"], 'E1097:', 2)
|
||||
CheckDefFailure(["var x = {'key': 8}"], 'E1014:', 1)
|
||||
CheckDefFailure(["var x = 'a' .. #{a: 1}"], 'E1097:', 2)
|
||||
|
||||
CheckDefFailure(["var x = {a:8}"], 'E1069:', 1)
|
||||
|
Reference in New Issue
Block a user