mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-20 11:40:18 +02:00
psyntax: access source properties for all supported objects
* module/ice-9/psyntax.scm (decorate-source): Set source properties on any object that satisfies 'supports-source-properties?'. Previously we used 'pair?' as the predicate. (source-annotation): Apply 'source-properties' to _any_ kind of source expression, where previously only pairs were queried. If the argument is a syntax-object, apply the source-properties to the syntax-object's expression. In the peculiar case of a syntax-object whose expression is also a syntax-object: previously we would iterate, but with this commit we now call 'syntax-object-expression' only once. * module/ice-9/psyntax-pp.scm: Regenerate.
This commit is contained in:
parent
76b9bac565
commit
32fbc38fbb
2 changed files with 6438 additions and 6372 deletions
File diff suppressed because it is too large
Load diff
|
@ -301,7 +301,7 @@
|
|||
|
||||
|
||||
(define (decorate-source e s)
|
||||
(if (and (pair? e) s)
|
||||
(if (and s (supports-source-properties? e))
|
||||
(set-source-properties! e s))
|
||||
e)
|
||||
|
||||
|
@ -461,14 +461,11 @@
|
|||
|
||||
(define source-annotation
|
||||
(lambda (x)
|
||||
(cond
|
||||
((syntax-object? x)
|
||||
(source-annotation (syntax-object-expression x)))
|
||||
((pair? x) (let ((props (source-properties x)))
|
||||
(if (pair? props)
|
||||
props
|
||||
#f)))
|
||||
(else #f))))
|
||||
(let ((props (source-properties
|
||||
(if (syntax-object? x)
|
||||
(syntax-object-expression x)
|
||||
x))))
|
||||
(and (pair? props) props))))
|
||||
|
||||
(define-syntax-rule (arg-check pred? e who)
|
||||
(let ((x e))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue