comparison src/vim9compile.c @ 26792:30d8377ea1b1 v8.2.3924

patch 8.2.3924: Vim9: no error if something follows :enddef Commit: https://github.com/vim/vim/commit/7473a84cf935f64ddd4ea7fe7eee0f9c51c50b60 Author: Bram Moolenaar <Bram@vim.org> Date: Tue Dec 28 17:55:26 2021 +0000 patch 8.2.3924: Vim9: no error if something follows :enddef Problem: Vim9: no error if something follows :enddef in a nested function. Solution: Give an error. Move common code to a function.
author Bram Moolenaar <Bram@vim.org>
date Tue, 28 Dec 2021 19:00:05 +0100
parents a8a4e1e7b111
children a6ccb6ec581c
comparison
equal deleted inserted replaced
26791:43989ce10dd1 26792:30d8377ea1b1
877 r = FAIL; 877 r = FAIL;
878 goto theend; 878 goto theend;
879 } 879 }
880 880
881 ufunc = define_function(eap, lambda_name, line_to_free); 881 ufunc = define_function(eap, lambda_name, line_to_free);
882
883 if (ufunc == NULL) 882 if (ufunc == NULL)
884 { 883 {
885 r = eap->skip ? OK : FAIL; 884 r = eap->skip ? OK : FAIL;
885 goto theend;
886 }
887 if (eap->nextcmd != NULL)
888 {
889 semsg(_(e_text_found_after_str_str),
890 eap->cmdidx == CMD_def ? "enddef" : "endfunction", eap->nextcmd);
891 r = FAIL;
886 goto theend; 892 goto theend;
887 } 893 }
888 894
889 // copy over the block scope IDs before compiling 895 // copy over the block scope IDs before compiling
890 if (!is_global && cctx->ctx_ufunc->uf_block_depth > 0) 896 if (!is_global && cctx->ctx_ufunc->uf_block_depth > 0)