mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-28 16:00:22 +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)
|
(define (decorate-source e s)
|
||||||
(if (and (pair? e) s)
|
(if (and s (supports-source-properties? e))
|
||||||
(set-source-properties! e s))
|
(set-source-properties! e s))
|
||||||
e)
|
e)
|
||||||
|
|
||||||
|
@ -461,14 +461,11 @@
|
||||||
|
|
||||||
(define source-annotation
|
(define source-annotation
|
||||||
(lambda (x)
|
(lambda (x)
|
||||||
(cond
|
(let ((props (source-properties
|
||||||
((syntax-object? x)
|
(if (syntax-object? x)
|
||||||
(source-annotation (syntax-object-expression x)))
|
(syntax-object-expression x)
|
||||||
((pair? x) (let ((props (source-properties x)))
|
x))))
|
||||||
(if (pair? props)
|
(and (pair? props) props))))
|
||||||
props
|
|
||||||
#f)))
|
|
||||||
(else #f))))
|
|
||||||
|
|
||||||
(define-syntax-rule (arg-check pred? e who)
|
(define-syntax-rule (arg-check pred? e who)
|
||||||
(let ((x e))
|
(let ((x e))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue