To: vim_dev@googlegroups.com Subject: Patch 8.2.1157 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.1157 Problem: Vim9: dict.name is not recognized as an expression. Solution: Recognize ".name". (closes #6418) Files: src/ex_docmd.c, src/testdir/test_vim9_cmd.vim *** ../vim-8.2.1156/src/ex_docmd.c 2020-07-05 18:18:24.342937456 +0200 --- src/ex_docmd.c 2020-07-08 18:03:55.144921418 +0200 *************** *** 3229,3241 **** // "varname[]" is an expression. // "g:varname" is an expression. // "varname->expr" is an expression. // "(..." is an expression. // "{..." is an dict expression. if (*p == '(' || *p == '{' || (*p == '[' && p > eap->cmd) || p[1] == ':' ! || (*p == '-' && p[1] == '>')) { eap->cmdidx = CMD_eval; return eap->cmd; --- 3229,3243 ---- // "varname[]" is an expression. // "g:varname" is an expression. // "varname->expr" is an expression. + // "varname.expr" is an expression. // "(..." is an expression. // "{..." is an dict expression. if (*p == '(' || *p == '{' || (*p == '[' && p > eap->cmd) || p[1] == ':' ! || (*p == '-' && p[1] == '>') ! || (*p == '.' && ASCII_ISALPHA(p[1]))) { eap->cmdidx = CMD_eval; return eap->cmd; *** ../vim-8.2.1156/src/testdir/test_vim9_cmd.vim 2020-07-06 23:04:44.829229830 +0200 --- src/testdir/test_vim9_cmd.vim 2020-07-08 18:26:48.395369813 +0200 *************** *** 208,213 **** --- 208,230 ---- CheckScriptSuccess(lines) enddef + def Test_dict_member() + let test: dict> = {'data': [3, 1, 2]} + test.data->sort() + assert_equal(#{data: [1, 2, 3]}, test) + test.data + ->reverse() + assert_equal(#{data: [3, 2, 1]}, test) + + let lines =<< trim END + vim9script + let test: dict> = {'data': [3, 1, 2]} + test.data->sort() + assert_equal(#{data: [1, 2, 3]}, test) + END + CheckScriptSuccess(lines) + enddef + def Test_bar_after_command() def RedrawAndEcho() let x = 'did redraw' *** ../vim-8.2.1156/src/version.c 2020-07-08 17:47:51.927988841 +0200 --- src/version.c 2020-07-08 18:29:19.002866687 +0200 *************** *** 756,757 **** --- 756,759 ---- { /* Add new patch number below this line */ + /**/ + 1157, /**/ -- Engineers understand that their appearance only bothers other people and therefore it is not worth optimizing. (Scott Adams - The Dilbert principle) /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///