Problem: Vim9: parsing declarations continues after :finish.
Solution: Bail out when encountering :finish.
], 'E488:')
enddef
+def Test_finish()
+ let lines =<< trim END
+ vim9script
+ let g:res = 'one'
+ if v:false | finish | endif
+ let g:res = 'two'
+ finish
+ let g:res = 'three'
+ END
+ writefile(lines, 'Xfinished')
+ source Xfinished
+ assert_equal('two', g:res)
+
+ unlet g:res
+ delete('Xfinished')
+enddef
+
" Keep this last, it messes up highlighting.
def Test_substitute_cmd()
new
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 731,
/**/
730,
/**/
vim_free(((char_u **)(gap->ga_data))[--gap->ga_len]);
((char_u **)(gap->ga_data))[gap->ga_len++] = NULL;
}
+ else if (checkforcmd(&p, "finish", 4))
+ {
+ // TODO: this should not happen below "if false".
+ // Use "if cond | finish | endif as a workaround.
+ break;
+ }
}
// Compile the :def functions.