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 -- [email protected] -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/20230112200537.73C611C7B46%40moolenaar.net.