mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-14 15:40:19 +02:00
keyword arg errors throw to 'keyword-argument-error
* libguile/vm-engine.c (VM_NAME): Keyword arg errors are now thrown to 'keyword-argument-error. * libguile/vm.c: Define sym_keyword_argument_error, and statically allocate some other symbols. * module/ice-9/optargs.scm (parse-lambda-case): Throw to 'keyword-argument-error in kwarg error cases. * module/ice-9/psyntax.scm (build-lambda-case): Remove a couple workarounds for the old memoizer. Throw to 'wrong-number-of-args if the lambda-case fails to parse. * module/ice-9/psyntax-pp.scm: Regenerated. * test-suite/tests/optargs.test: Update expected exceptions.
This commit is contained in:
parent
1ad7fef524
commit
f6a8e79197
6 changed files with 8998 additions and 8896 deletions
|
@ -130,6 +130,8 @@ VM_NAME (SCM vm, SCM program, SCM *argv, int nargs)
|
|||
{
|
||||
SCM err_msg;
|
||||
|
||||
/* FIXME: need to sync regs before allocating anything, in each case. */
|
||||
|
||||
vm_error_bad_instruction:
|
||||
err_msg = scm_from_locale_string ("VM: Bad instruction: ~s");
|
||||
finish_args = scm_list_1 (scm_from_uchar (ip[-1]));
|
||||
|
@ -145,19 +147,24 @@ VM_NAME (SCM vm, SCM program, SCM *argv, int nargs)
|
|||
goto vm_error;
|
||||
|
||||
vm_error_kwargs_length_not_even:
|
||||
err_msg = scm_from_locale_string ("Bad keyword argument list: odd length");
|
||||
finish_args = SCM_EOL;
|
||||
goto vm_error;
|
||||
SYNC_ALL ();
|
||||
err_msg = scm_from_locale_string ("Odd length of keyword argument list");
|
||||
scm_error_scm (sym_keyword_argument_error, program, err_msg,
|
||||
SCM_EOL, SCM_BOOL_F);
|
||||
|
||||
vm_error_kwargs_invalid_keyword:
|
||||
err_msg = scm_from_locale_string ("Bad keyword argument list: expected keyword");
|
||||
finish_args = SCM_EOL;
|
||||
goto vm_error;
|
||||
/* FIXME say which one it was */
|
||||
SYNC_ALL ();
|
||||
err_msg = scm_from_locale_string ("Invalid keyword");
|
||||
scm_error_scm (sym_keyword_argument_error, program, err_msg,
|
||||
SCM_EOL, SCM_BOOL_F);
|
||||
|
||||
vm_error_kwargs_unrecognized_keyword:
|
||||
err_msg = scm_from_locale_string ("Bad keyword argument list: unrecognized keyword");
|
||||
finish_args = SCM_EOL;
|
||||
goto vm_error;
|
||||
/* FIXME say which one it was */
|
||||
SYNC_ALL ();
|
||||
err_msg = scm_from_locale_string ("Unrecognized keyword");
|
||||
scm_error_scm (sym_keyword_argument_error, program, err_msg,
|
||||
SCM_EOL, SCM_BOOL_F);
|
||||
|
||||
vm_error_too_many_args:
|
||||
err_msg = scm_from_locale_string ("VM: Too many arguments");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue