diff options
author | Bram Moolenaar <Bram@vim.org> | 2021-07-18 18:21:38 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2021-07-18 18:21:38 +0200 |
commit | 4db572eeb2b42819268e934e76c67163316d873f (patch) | |
tree | 7c7b632b8808211dcaecb968090f31aac4e2b13a /src/vim9compile.c | |
parent | ad2d4969e1616d3a0354c181e3a09271d5433b3d (diff) |
patch 8.2.3178: Vim9: the file name of an :import cannot be an expressionv8.2.3178
Problem: Vim9: the file name of an :import cannot be an expression.
Solution: Accept an expression that results in a string. Do not support
:import in a function.
Diffstat (limited to 'src/vim9compile.c')
-rw-r--r-- | src/vim9compile.c | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/src/vim9compile.c b/src/vim9compile.c index 9ae11a54b1..12dd19823a 100644 --- a/src/vim9compile.c +++ b/src/vim9compile.c @@ -4335,7 +4335,6 @@ compile_subscript( semsg(_(e_missing_paren), *arg); return FAIL; } - // TODO: base value may not be the first argument if (compile_call(arg, p - *arg, cctx, ppconst, 1) == FAIL) return FAIL; } @@ -7294,15 +7293,6 @@ compile_unletlock(char_u *arg, exarg_T *eap, cctx_T *cctx) } /* - * Compile an :import command. - */ - static char_u * -compile_import(char_u *arg, cctx_T *cctx) -{ - return handle_import(arg, &cctx->ctx_imports, 0, NULL, cctx); -} - -/* * generate a jump to the ":endif"/":endfor"/":endwhile"/":finally"/":endtry". */ static int @@ -9638,7 +9628,8 @@ compile_def_function( break; case CMD_import: - line = compile_import(p, &cctx); + emsg(_(e_import_can_only_be_used_in_script)); + line = NULL; break; case CMD_if: |