patch 8.2.5026: Vim9: a few lines not covered by tests
Problem: Vim9: a few lines not covered by tests.
Solution: Delete dead code. Add a few test cases. make "12->func()" work.
diff --git a/src/vim9compile.c b/src/vim9compile.c
index 496f4cd..b7f590e 100644
--- a/src/vim9compile.c
+++ b/src/vim9compile.c
@@ -3001,6 +3001,7 @@
* 0z1234->func() should not be confused with a zero line number
* "++nr" and "--nr" are eval commands
* in "$ENV->func()" the "$" is not a range
+ * "123->func()" is a method call
*/
cmd = ea.cmd;
if ((*cmd != '$' || starts_with_colon)
@@ -3008,7 +3009,8 @@
|| !(*cmd == '\''
|| (cmd[0] == '0' && cmd[1] == 'z')
|| (cmd[0] != NUL && cmd[0] == cmd[1]
- && (*cmd == '+' || *cmd == '-')))))
+ && (*cmd == '+' || *cmd == '-'))
+ || number_method(cmd))))
{
ea.cmd = skip_range(ea.cmd, TRUE, NULL);
if (ea.cmd > cmd)