mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-10 05:50:26 +02:00
make expand-support structure constructors take a source argument
* module/ice-9/expand-support.scm (make-module-ref, make-lexical): Add source arguments to these constructors. * module/ice-9/psyntax.scm: * module/ice-9/psyntax-pp.scm: Adapt to match, though we don't wire everything up yet.
This commit is contained in:
parent
f27e9e11cd
commit
1aeb082b82
3 changed files with 8 additions and 8 deletions
|
@ -102,7 +102,7 @@
|
||||||
(define (module-ref? x)
|
(define (module-ref? x)
|
||||||
(and (struct? x) (eq? (struct-vtable x) <module-ref>)))
|
(and (struct? x) (eq? (struct-vtable x) <module-ref>)))
|
||||||
|
|
||||||
(define (make-module-ref modname symbol public?)
|
(define (make-module-ref source modname symbol public?)
|
||||||
(make-struct <module-ref> 0 modname symbol public?))
|
(make-struct <module-ref> 0 modname symbol public?))
|
||||||
|
|
||||||
(define (module-ref-modname a)
|
(define (module-ref-modname a)
|
||||||
|
@ -126,7 +126,7 @@
|
||||||
(define (lexical? x)
|
(define (lexical? x)
|
||||||
(and (struct? x) (eq? (struct-vtable x) <lexical>)))
|
(and (struct? x) (eq? (struct-vtable x) <lexical>)))
|
||||||
|
|
||||||
(define (make-lexical name gensym)
|
(define (make-lexical source name gensym)
|
||||||
(make-struct <lexical> 0 name gensym))
|
(make-struct <lexical> 0 name gensym))
|
||||||
|
|
||||||
(define (lexical-name a)
|
(define (lexical-name a)
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -371,7 +371,7 @@
|
||||||
(build-annotated
|
(build-annotated
|
||||||
source
|
source
|
||||||
(case (fluid-ref *mode*)
|
(case (fluid-ref *mode*)
|
||||||
((c) ((@ (ice-9 expand-support) make-lexical) name var))
|
((c) ((@ (ice-9 expand-support) make-lexical) source name var))
|
||||||
(else var)))))
|
(else var)))))
|
||||||
|
|
||||||
(define build-lexical-assignment
|
(define build-lexical-assignment
|
||||||
|
@ -398,19 +398,19 @@
|
||||||
(let ((make-module-ref
|
(let ((make-module-ref
|
||||||
(case (fluid-ref *mode*)
|
(case (fluid-ref *mode*)
|
||||||
((c) (@ (ice-9 expand-support) make-module-ref))
|
((c) (@ (ice-9 expand-support) make-module-ref))
|
||||||
(else (lambda (mod var public?)
|
(else (lambda (source mod var public?)
|
||||||
(list (if public? '@ '@@) mod var)))))
|
(list (if public? '@ '@@) mod var)))))
|
||||||
(kind (car mod))
|
(kind (car mod))
|
||||||
(mod (cdr mod)))
|
(mod (cdr mod)))
|
||||||
(case kind
|
(case kind
|
||||||
((public) (make-module-ref mod var #t))
|
((public) (make-module-ref #f mod var #t))
|
||||||
((private) (if (not (equal? mod (module-name (current-module))))
|
((private) (if (not (equal? mod (module-name (current-module))))
|
||||||
(make-module-ref mod var #f)
|
(make-module-ref #f mod var #f)
|
||||||
var))
|
var))
|
||||||
((bare) var)
|
((bare) var)
|
||||||
((hygiene) (if (and (not (equal? mod (module-name (current-module))))
|
((hygiene) (if (and (not (equal? mod (module-name (current-module))))
|
||||||
(module-variable (resolve-module mod) var))
|
(module-variable (resolve-module mod) var))
|
||||||
(make-module-ref mod var #f)
|
(make-module-ref #f mod var #f)
|
||||||
var))
|
var))
|
||||||
(else (syntax-violation #f "bad module kind" var mod))))))))
|
(else (syntax-violation #f "bad module kind" var mod))))))))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue