Mercurial > vim
comparison src/vim9script.c @ 20351:680296770464 v8.2.0731
patch 8.2.0731: Vim9: parsing declarations continues after :finish
Commit: https://github.com/vim/vim/commit/7e5bd91dc99e1ecb38c4220eaab1a906a69815c2
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun May 10 21:20:29 2020 +0200
patch 8.2.0731: Vim9: parsing declarations continues after :finish
Problem: Vim9: parsing declarations continues after :finish.
Solution: Bail out when encountering :finish.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 10 May 2020 21:30:04 +0200 |
parents | 7587d892c00c |
children | 918b9a05cf35 |
comparison
equal
deleted
inserted
replaced
20350:3362f6227205 | 20351:680296770464 |
---|---|
127 ex_import(eap); | 127 ex_import(eap); |
128 | 128 |
129 // Store empty line, we don't need to process the command again. | 129 // Store empty line, we don't need to process the command again. |
130 vim_free(((char_u **)(gap->ga_data))[--gap->ga_len]); | 130 vim_free(((char_u **)(gap->ga_data))[--gap->ga_len]); |
131 ((char_u **)(gap->ga_data))[gap->ga_len++] = NULL; | 131 ((char_u **)(gap->ga_data))[gap->ga_len++] = NULL; |
132 } | |
133 else if (checkforcmd(&p, "finish", 4)) | |
134 { | |
135 // TODO: this should not happen below "if false". | |
136 // Use "if cond | finish | endif as a workaround. | |
137 break; | |
132 } | 138 } |
133 } | 139 } |
134 | 140 |
135 // Compile the :def functions. | 141 // Compile the :def functions. |
136 for (idx = 0; idx < func_ga.ga_len; ++idx) | 142 for (idx = 0; idx < func_ga.ga_len; ++idx) |