summaryrefslogtreecommitdiff
path: root/libguile/vm-engine.c
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2009-12-23 22:59:12 +0100
committerAndy Wingo <wingo@pobox.com>2009-12-23 22:59:12 +0100
commitf6a8e7919755ce15cd75ad01326e02151fa99445 (patch)
tree66c4b0ce2f2a81133853375a21785f728f32b0fd /libguile/vm-engine.c
parent1ad7fef5249f409317c20d5242bc3c4c2b8d9d18 (diff)
downloadguile-f6a8e7919755ce15cd75ad01326e02151fa99445.tar.gz
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.
Diffstat (limited to 'libguile/vm-engine.c')
-rw-r--r--libguile/vm-engine.c25
1 files changed, 16 insertions, 9 deletions
diff --git a/libguile/vm-engine.c b/libguile/vm-engine.c
index 4f2dff218..a64b43a47 100644
--- a/libguile/vm-engine.c
+++ b/libguile/vm-engine.c
@@ -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");