mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-24 20:30:28 +02:00
* libguile/eval.c (scm_m_let, scm_m_letstar, scm_m_letrec,
scm_m_expand_body, check_bindings): Extracted syntax checking of bindings to new static function check_bindings. (scm_m_let, memoize_named_let): Extracted handling of named let to new static function memoize_named_let. (transform_bindings, scm_m_let, scm_m_letstar, scm_m_letrec): Use ASSERT_SYNTAX to signal syntax errors. Be more specific about the kind of error that was detected. Avoid use of SCM_CDRLOC. Avoid unnecessary consing when creating the memoized code. * test-suite/lib.scm (exception:bad-variable): New. * test-suite/tests/syntax.test (exception:bad-binding, exception:duplicate-binding): New. (exception:duplicate-bindings): Removed. Adapted tests for 'let', 'let*' and 'letrec' to the new way of error reporting.
This commit is contained in:
parent
2ec8656041
commit
d6754c2398
5 changed files with 218 additions and 143 deletions
|
@ -22,6 +22,7 @@
|
|||
:export (
|
||||
|
||||
;; Exceptions which are commonly being tested for.
|
||||
exception:bad-variable
|
||||
exception:missing-expression
|
||||
exception:out-of-range exception:unbound-var
|
||||
exception:wrong-num-args exception:wrong-type-arg
|
||||
|
@ -233,6 +234,8 @@
|
|||
;;;;
|
||||
|
||||
;;; Define some exceptions which are commonly being tested for.
|
||||
(define exception:bad-variable
|
||||
(cons 'syntax-error "Bad variable"))
|
||||
(define exception:missing-expression
|
||||
(cons 'misc-error "^missing or extra expression"))
|
||||
(define exception:out-of-range
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue