Fixing extract-module-file-docs for a library outside the search path.

This commit is contained in:
Alex Shinn 2015-05-10 20:45:01 +09:00
parent 6ef0a69a5b
commit 8cd5fd2848
2 changed files with 11 additions and 5 deletions

View file

@ -941,7 +941,9 @@ div#footer {padding-bottom: 50px}
(let* ((mod-form (car forms)) (let* ((mod-form (car forms))
(mod-name (cadr mod-form))) (mod-name (cadr mod-form)))
(load file (vector-ref (find-module '(meta)) 1)) (load file (vector-ref (find-module '(meta)) 1))
(let ((mod (load-module mod-name))) (let* ((mod (protect (exn (else #f)) (load-module mod-name)))
(dir (path-directory file))
(resolve (lambda (f) (make-path dir f))))
(define (get-forms name) (define (get-forms name)
(append-map (append-map
(lambda (x) (if (and (pair? x) (eq? name (car x))) (cdr x) '())) (lambda (x) (if (and (pair? x) (eq? name (car x))) (cdr x) '()))
@ -951,11 +953,15 @@ div#footer {padding-bottom: 50px}
(define (get-decls) (define (get-decls)
(if mod (if mod
(module-include-library-declarations mod) (module-include-library-declarations mod)
(get-forms 'include-library-declarations))) (map resolve (get-forms 'include-library-declarations))))
(define (get-includes) (define (get-includes)
(if mod (module-includes mod) (get-forms 'include))) (if mod
(module-includes mod)
(map resolve (get-forms 'include))))
(define (get-shared-includes) (define (get-shared-includes)
(if mod (module-shared-includes mod) (get-forms 'shared-include))) (if mod
(module-shared-includes mod)
(map resolve (get-forms 'shared-include))))
(let* ((exports (if (pair? o) (car o) (get-exports))) (let* ((exports (if (pair? o) (car o) (get-exports)))
(srcs (cons file (get-decls)))) (srcs (cons file (get-decls))))
(extract-module-docs-from-files (extract-module-docs-from-files

View file

@ -3,7 +3,7 @@
(import (import
(except (chibi) eval) (scheme eval) (srfi 1) (srfi 95) (except (chibi) eval) (scheme eval) (srfi 1) (srfi 95)
(chibi modules) (chibi ast) (chibi io) (chibi match) (chibi modules) (chibi ast) (chibi io) (chibi match)
(chibi time) (chibi filesystem) (chibi process) (chibi time) (chibi filesystem) (chibi process) (chibi pathname)
(chibi string) (chibi scribble) (chibi sxml) (chibi highlight) (chibi string) (chibi scribble) (chibi sxml) (chibi highlight)
(chibi type-inference)) (chibi type-inference))
(export procedure-docs print-procedure-docs (export procedure-docs print-procedure-docs