mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-21 20:20:24 +02:00
Fix psyntax bugs that would cause bad source annotations
* module/ice-9/psyntax.scm (rebuild-macro-output): Fix two bugs that would cause bogus source properties to be added to vectors and macro-introduced syntax objects. These bugs were masked by the limitation that only pairs can be decorated with source properties. Due to a typo, each vector in the macro output was decorated using the vector itself as its source. Due to accidental variable capture, each syntax-object introduced by the macro had its expression decorated with its own wrap-subst. * module/ice-9/psyntax-pp.scm: Regenerate.
This commit is contained in:
parent
db24306887
commit
30398e94f9
2 changed files with 6585 additions and 6563 deletions
File diff suppressed because it is too large
Load diff
|
@ -1385,25 +1385,25 @@
|
|||
s))
|
||||
((syntax-object? x)
|
||||
(let ((w (syntax-object-wrap x)))
|
||||
(let ((ms (wrap-marks w)) (s (wrap-subst w)))
|
||||
(let ((ms (wrap-marks w)) (ss (wrap-subst w)))
|
||||
(if (and (pair? ms) (eq? (car ms) the-anti-mark))
|
||||
;; output is from original text
|
||||
(make-syntax-object
|
||||
(syntax-object-expression x)
|
||||
(make-wrap (cdr ms) (if rib (cons rib (cdr s)) (cdr s)))
|
||||
(make-wrap (cdr ms) (if rib (cons rib (cdr ss)) (cdr ss)))
|
||||
(syntax-object-module x))
|
||||
;; output introduced by macro
|
||||
(make-syntax-object
|
||||
(decorate-source (syntax-object-expression x) s)
|
||||
(make-wrap (cons m ms)
|
||||
(if rib
|
||||
(cons rib (cons 'shift s))
|
||||
(cons 'shift s)))
|
||||
(cons rib (cons 'shift ss))
|
||||
(cons 'shift ss)))
|
||||
(syntax-object-module x))))))
|
||||
|
||||
((vector? x)
|
||||
(let* ((n (vector-length x))
|
||||
(v (decorate-source (make-vector n) x)))
|
||||
(v (decorate-source (make-vector n) s)))
|
||||
(do ((i 0 (fx+ i 1)))
|
||||
((fx= i n) v)
|
||||
(vector-set! v i
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue