summaryrefslogtreecommitdiff
path: root/src/vim9compile.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-05-26 22:24:43 +0100
committerBram Moolenaar <Bram@vim.org>2022-05-26 22:24:43 +0100
commit31d9948e3a2529c2f619d56bdb48291dc261233d (patch)
tree9d190d121b8851b0d861455ba61b09fd03da8776 /src/vim9compile.c
parent5cb53b7afe6bde8f2bf6fc6b65b86071b67a8554 (diff)
downloadvim-git-31d9948e3a2529c2f619d56bdb48291dc261233d.tar.gz
patch 8.2.5026: Vim9: a few lines not covered by testsv8.2.5026
Problem: Vim9: a few lines not covered by tests. Solution: Delete dead code. Add a few test cases. make "12->func()" work.
Diffstat (limited to 'src/vim9compile.c')
-rw-r--r--src/vim9compile.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/vim9compile.c b/src/vim9compile.c
index 496f4cde2..b7f590e10 100644
--- a/src/vim9compile.c
+++ b/src/vim9compile.c
@@ -3001,6 +3001,7 @@ compile_def_function(
* 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 @@ compile_def_function(
|| !(*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)