To: vim_dev@googlegroups.com Subject: Patch 9.0.1186 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 9.0.1186 Problem: Imported class does not work when used twice in a line. Solution: Fix the type parsing. Files: src/evalvars.c, src/testdir/test_vim9_class.vim *** ../vim-9.0.1185/src/evalvars.c 2023-01-12 17:06:24.136720890 +0000 --- src/evalvars.c 2023-01-12 20:03:24.844367971 +0000 *************** *** 3122,3129 **** return FAIL; if (rettv->v_type == VAR_ANY && *s == '.') { int sid = rettv->vval.v_number; ! return eval_variable(s + 1, 0, sid, rettv, NULL, 0); } return OK; } --- 3122,3133 ---- return FAIL; if (rettv->v_type == VAR_ANY && *s == '.') { + char_u *ns = s + 1; + s = ns; + while (ASCII_ISALNUM(*s) || *s == '_') + ++s; int sid = rettv->vval.v_number; ! return eval_variable(ns, (int)(s - ns), sid, rettv, NULL, 0); } return OK; } *** ../vim-9.0.1185/src/testdir/test_vim9_class.vim 2023-01-12 17:06:24.136720890 +0000 --- src/testdir/test_vim9_class.vim 2023-01-12 19:44:13.992887085 +0000 *************** *** 992,997 **** --- 992,1001 ---- a = animal.Animal.new('fish', 'Eric') assert_equal('fish', a.kind) assert_equal('Eric', a.name) + + var b: animal.Animal = animal.Animal.new('cat', 'Garfield') + assert_equal('cat', b.kind) + assert_equal('Garfield', b.name) END v9.CheckScriptSuccess(lines) enddef *** ../vim-9.0.1185/src/version.c 2023-01-12 17:06:24.140720888 +0000 --- src/version.c 2023-01-12 19:49:02.028701873 +0000 *************** *** 697,698 **** --- 697,700 ---- { /* Add new patch number below this line */ + /**/ + 1186, /**/ -- I learned the customs and mannerisms of engineers by observing them, much the way Jane Goodall learned about the great apes, but without the hassle of grooming. (Scott Adams - The Dilbert principle) /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///