Mercurial > vim
comparison src/userfunc.c @ 27472:55613f0d59bc v8.2.4264
patch 8.2.4264: Vim9: can use old style autoload function name
Commit: https://github.com/vim/vim/commit/d8fe6d34bb582438142d7c1f73d0bd8537bb3a7a
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Jan 30 18:40:44 2022 +0000
patch 8.2.4264: Vim9: can use old style autoload function name
Problem: Vim9: can use old style autoload function name.
Solution: Give an error for old style autoload function name.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 30 Jan 2022 19:45:03 +0100 |
parents | a14c4d3e3260 |
children | 4f1cf9579e4e |
comparison
equal
deleted
inserted
replaced
27471:769fe460984e | 27472:55613f0d59bc |
---|---|
4230 { | 4230 { |
4231 vim_free(name); | 4231 vim_free(name); |
4232 name = prefixed; | 4232 name = prefixed; |
4233 } | 4233 } |
4234 } | 4234 } |
4235 else if (vim9script && vim_strchr(name, AUTOLOAD_CHAR) != NULL) | |
4236 { | |
4237 emsg(_(e_cannot_use_name_with_hash_in_vim9_script_use_export_instead)); | |
4238 goto ret_free; | |
4239 } | |
4235 } | 4240 } |
4236 | 4241 |
4237 // An error in a function call during evaluation of an expression in magic | 4242 // An error in a function call during evaluation of an expression in magic |
4238 // braces should not cause the function not to be defined. | 4243 // braces should not cause the function not to be defined. |
4239 saved_did_emsg = did_emsg; | 4244 saved_did_emsg = did_emsg; |
4537 if (v != NULL) | 4542 if (v != NULL) |
4538 var_conflict = TRUE; | 4543 var_conflict = TRUE; |
4539 vim_free(prefixed); | 4544 vim_free(prefixed); |
4540 } | 4545 } |
4541 } | 4546 } |
4542 } | |
4543 else if (vim9script && vim_strchr(name, AUTOLOAD_CHAR) != NULL) | |
4544 { | |
4545 semsg(_(e_using_autoload_name_in_non_autoload_script_str), | |
4546 name); | |
4547 goto erret; | |
4548 } | 4547 } |
4549 } | 4548 } |
4550 if (var_conflict) | 4549 if (var_conflict) |
4551 { | 4550 { |
4552 emsg_funcname(e_function_name_conflicts_with_variable_str, name); | 4551 emsg_funcname(e_function_name_conflicts_with_variable_str, name); |