Patch 8.2.1098
Problem: Vim9: cannot use line break in :throw argument.
Solution: Check for line break.
Files: src/eval.c, src/testdir/test_vim9_script.vim
*** ../vim-8.2.1097/src/eval.c 2020-06-29 22:31:32.403297618 +0200
--- src/eval.c 2020-06-30 20:53:43.680854461 +0200
***************
*** 333,342 ****
{
typval_T tv;
char_u *retval;
if (skip)
++emsg_skip;
! if (eval0(arg, &tv, eap, skip ? NULL : &EVALARG_EVALUATE) == FAIL || skip)
retval = NULL;
else
{
--- 333,350 ----
{
typval_T tv;
char_u *retval;
+ evalarg_T evalarg;
+ CLEAR_FIELD(evalarg);
+ evalarg.eval_flags = skip ? 0 : EVAL_EVALUATE;
+ if (eap != NULL && getline_equal(eap->getline, eap->cookie,
getsourceline))
+ {
+ evalarg.eval_getline = eap->getline;
+ evalarg.eval_cookie = eap->cookie;
+ }
if (skip)
++emsg_skip;
! if (eval0(arg, &tv, eap, &evalarg) == FAIL || skip)
retval = NULL;
else
{
***************
*** 345,351 ****
}
if (skip)
--emsg_skip;
! clear_evalarg(&EVALARG_EVALUATE, eap);
return retval;
}
--- 353,359 ----
}
if (skip)
--emsg_skip;
! clear_evalarg(&evalarg, eap);
return retval;
}
*** ../vim-8.2.1097/src/testdir/test_vim9_script.vim 2020-06-22
23:02:14.773942551 +0200
--- src/testdir/test_vim9_script.vim 2020-06-30 20:54:02.048745561 +0200
***************
*** 585,590 ****
--- 585,604 ----
call CheckDefFailure(['throw xxx'], 'E1001:')
enddef
+ def Test_throw_vimscript()
+ " only checks line continuation
+ let lines =<< trim END
+ vim9script
+ try
+ throw 'one'
+ .. 'two'
+ catch
+ assert_equal('onetwo', v:exception)
+ endtry
+ END
+ CheckScriptSuccess(lines)
+ enddef
+
if has('channel')
let someJob = test_null_job()
*** ../vim-8.2.1097/src/version.c 2020-06-30 18:45:40.005526178 +0200
--- src/version.c 2020-06-30 20:51:53.085509839 +0200
***************
*** 756,757 ****
--- 756,759 ----
{ /* Add new patch number below this line */
+ /**/
+ 1098,
/**/
--
The problem with political jokes is that they get elected.
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/202006301855.05UItiQd967718%40masaka.moolenaar.net.