Patch 9.0.1186

5 views
Skip to first unread message

Bram Moolenaar

unread,
Jan 12, 2023, 3:05:42 PM1/12/23
to vim...@googlegroups.com

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 -- Br...@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 ///
Reply all
Reply to author
Forward
0 new messages