syntax-violation uses lambda*, throws a structured message

* module/ice-9/psyntax.scm (syntax-violation): Use lambda* for subform
  arg. Instead of using scm-error, just throw to 'syntax-error with all
  we got.

* module/ice-9/psyntax-pp.scm (#{and-map*\ 37}): Regenerated.
This commit is contained in:
Andy Wingo 2010-11-16 02:09:03 +01:00
commit 8f1870f20f
2 changed files with 8201 additions and 8312 deletions

File diff suppressed because it is too large Load diff

View file

@ -2415,20 +2415,14 @@
(bound-id=? x y))) (bound-id=? x y)))
(set! syntax-violation (set! syntax-violation
(lambda (who message form . subform) (lambda* (who message form #:optional subform)
(arg-check (lambda (x) (or (not x) (string? x) (symbol? x))) (arg-check (lambda (x) (or (not x) (string? x) (symbol? x)))
who 'syntax-violation) who 'syntax-violation)
(arg-check string? message 'syntax-violation) (arg-check string? message 'syntax-violation)
(scm-error 'syntax-error 'macroexpand (throw 'syntax-error who message
(string-append (source-annotation (or form subform))
(if who "~a: " "") (strip form empty-wrap)
"~a " (and subform (strip subform empty-wrap)))))
(if (null? subform) "in ~a" "in subform `~s' of `~s'"))
(let ((tail (cons message
(map (lambda (x) (strip x empty-wrap))
(append subform (list form))))))
(if who (cons who tail) tail))
#f)))
;; $sc-dispatch expects an expression and a pattern. If the expression ;; $sc-dispatch expects an expression and a pattern. If the expression
;; matches the pattern a list of the matching expressions for each ;; matches the pattern a list of the matching expressions for each