mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-03 13:20:26 +02:00
modules have field for their filenames, for debugging
* module/ice-9/boot-9.scm (module-filename, set-module-filename!): Add a new field to modules, the filename that is associated with the module. For debugging purposes. (process-define-module): Parse out a #:filename argument. (make-module, make-autoload-interface): Adapt to module-constructor change. (define-module): Init module-filename from (current-source-location).
This commit is contained in:
parent
41147ee732
commit
78f79f18e2
1 changed files with 19 additions and 4 deletions
|
@ -1581,7 +1581,8 @@ If there is no handler at all, Guile prints an error and then exits."
|
||||||
version
|
version
|
||||||
submodules
|
submodules
|
||||||
submodule-binder
|
submodule-binder
|
||||||
public-interface)))
|
public-interface
|
||||||
|
filename)))
|
||||||
|
|
||||||
|
|
||||||
;; make-module &opt size uses binder
|
;; make-module &opt size uses binder
|
||||||
|
@ -1623,7 +1624,7 @@ If there is no handler at all, Guile prints an error and then exits."
|
||||||
(make-hash-table %default-import-size)
|
(make-hash-table %default-import-size)
|
||||||
'()
|
'()
|
||||||
(make-weak-key-hash-table 31) #f
|
(make-weak-key-hash-table 31) #f
|
||||||
(make-hash-table 7) #f #f)))
|
(make-hash-table 7) #f #f #f)))
|
||||||
|
|
||||||
;; We can't pass this as an argument to module-constructor,
|
;; We can't pass this as an argument to module-constructor,
|
||||||
;; because we need it to close over a pointer to the module
|
;; because we need it to close over a pointer to the module
|
||||||
|
@ -2650,6 +2651,16 @@ If there is no handler at all, Guile prints an error and then exits."
|
||||||
re-exports
|
re-exports
|
||||||
(append (cadr kws) replacements)
|
(append (cadr kws) replacements)
|
||||||
autoloads))
|
autoloads))
|
||||||
|
((#:filename)
|
||||||
|
(or (pair? (cdr kws))
|
||||||
|
(unrecognized kws))
|
||||||
|
(set-module-filename! module (cadr kws))
|
||||||
|
(loop (cddr kws)
|
||||||
|
reversed-interfaces
|
||||||
|
exports
|
||||||
|
re-exports
|
||||||
|
replacements
|
||||||
|
autoloads))
|
||||||
(else
|
(else
|
||||||
(unrecognized kws)))))
|
(unrecognized kws)))))
|
||||||
(run-hook module-defined-hook module)
|
(run-hook module-defined-hook module)
|
||||||
|
@ -2679,7 +2690,7 @@ If there is no handler at all, Guile prints an error and then exits."
|
||||||
(module-local-variable i sym))))))
|
(module-local-variable i sym))))))
|
||||||
(module-constructor (make-hash-table 0) '() b #f #f name 'autoload #f
|
(module-constructor (make-hash-table 0) '() b #f #f name 'autoload #f
|
||||||
(make-hash-table 0) '() (make-weak-value-hash-table 31) #f
|
(make-hash-table 0) '() (make-weak-value-hash-table 31) #f
|
||||||
(make-hash-table 0) #f #f)))
|
(make-hash-table 0) #f #f #f)))
|
||||||
|
|
||||||
(define (module-autoload! module . args)
|
(define (module-autoload! module . args)
|
||||||
"Have @var{module} automatically load the module named @var{name} when one
|
"Have @var{module} automatically load the module named @var{name} when one
|
||||||
|
@ -3320,7 +3331,11 @@ module '(ice-9 q) '(make-q q-length))}."
|
||||||
(with-syntax (((quoted-arg ...) (quotify #'(arg ...))))
|
(with-syntax (((quoted-arg ...) (quotify #'(arg ...))))
|
||||||
#'(eval-when (eval load compile expand)
|
#'(eval-when (eval load compile expand)
|
||||||
(let ((m (process-define-module
|
(let ((m (process-define-module
|
||||||
(list '(name name* ...) quoted-arg ...))))
|
(list '(name name* ...)
|
||||||
|
#:filename (assq-ref
|
||||||
|
(or (current-source-location) '())
|
||||||
|
'filename)
|
||||||
|
quoted-arg ...))))
|
||||||
(set-current-module m)
|
(set-current-module m)
|
||||||
m)))))))
|
m)))))))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue