Mercurial > vim
comparison src/vim9compile.c @ 25680:8556ded8a462 v8.2.3376
patch 8.2.3376: Vim9: no warning that "@r" does not do anything
Commit: https://github.com/vim/vim/commit/4799cef85ce43e26f5022290b41a7c85bbab8cad
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Aug 25 22:37:36 2021 +0200
patch 8.2.3376: Vim9: no warning that "@r" does not do anything
Problem: Vim9: no warning that "@r" does not do anything.
Solution: Give a "no effect" error. (closes https://github.com/vim/vim/issues/8779)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Wed, 25 Aug 2021 22:45:04 +0200 |
parents | 812c75fd255c |
children | f31cf0388eab |
comparison
equal
deleted
inserted
replaced
25679:b633748f3acb | 25680:8556ded8a462 |
---|---|
8826 static char_u * | 8826 static char_u * |
8827 compile_eval(char_u *arg, cctx_T *cctx) | 8827 compile_eval(char_u *arg, cctx_T *cctx) |
8828 { | 8828 { |
8829 char_u *p = arg; | 8829 char_u *p = arg; |
8830 int name_only; | 8830 int name_only; |
8831 char_u *alias; | |
8832 long lnum = SOURCING_LNUM; | 8831 long lnum = SOURCING_LNUM; |
8833 | 8832 |
8834 // find_ex_command() will consider a variable name an expression, assuming | 8833 // find_ex_command() will consider a variable name an expression, assuming |
8835 // that something follows on the next line. Check that something actually | 8834 // that something follows on the next line. Check that something actually |
8836 // follows, otherwise it's probably a misplaced command. | 8835 // follows, otherwise it's probably a misplaced command. |
8837 get_name_len(&p, &alias, FALSE, FALSE); | 8836 name_only = cmd_is_name_only(arg); |
8838 name_only = ends_excmd2(arg, skipwhite(p)); | 8837 |
8839 vim_free(alias); | |
8840 | |
8841 p = arg; | |
8842 if (compile_expr0(&p, cctx) == FAIL) | 8838 if (compile_expr0(&p, cctx) == FAIL) |
8843 return NULL; | 8839 return NULL; |
8844 | 8840 |
8845 if (name_only && lnum == SOURCING_LNUM) | 8841 if (name_only && lnum == SOURCING_LNUM) |
8846 { | 8842 { |