mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-20 03:30:27 +02:00
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:
parent
a6f3af1618
commit
8f1870f20f
2 changed files with 8201 additions and 8312 deletions
File diff suppressed because it is too large
Load diff
|
@ -2415,20 +2415,14 @@
|
|||
(bound-id=? x y)))
|
||||
|
||||
(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)))
|
||||
who 'syntax-violation)
|
||||
(arg-check string? message 'syntax-violation)
|
||||
(scm-error 'syntax-error 'macroexpand
|
||||
(string-append
|
||||
(if who "~a: " "")
|
||||
"~a "
|
||||
(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)))
|
||||
(throw 'syntax-error who message
|
||||
(source-annotation (or form subform))
|
||||
(strip form empty-wrap)
|
||||
(and subform (strip subform empty-wrap)))))
|
||||
|
||||
;; $sc-dispatch expects an expression and a pattern. If the expression
|
||||
;; matches the pattern a list of the matching expressions for each
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue