From 71c707df50461805969bec6abcd7dcc364eaf00a Mon Sep 17 00:00:00 2001 From: Abdulaziz Ghuloum Date: Sat, 3 Jan 2009 20:23:33 -0500 Subject: [PATCH] missing library file errors now print import trace. --- scheme/last-revision | 2 +- scheme/psyntax.compat.ss | 12 ++++++++---- scheme/psyntax.library-manager.ss | 7 ++++++- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/scheme/last-revision b/scheme/last-revision index 741f5d6..e6a6560 100644 --- a/scheme/last-revision +++ b/scheme/last-revision @@ -1 +1 @@ -1738 +1739 diff --git a/scheme/psyntax.compat.ss b/scheme/psyntax.compat.ss index 8cbba8a..a224719 100644 --- a/scheme/psyntax.compat.ss +++ b/scheme/psyntax.compat.ss @@ -37,20 +37,24 @@ source.\n" name depname filename)) - (define (file-locator-resolution-error libname failed-list) + (define (file-locator-resolution-error libname failed-list pending-list) (define-condition-type &library-resolution &condition make-library-resolution-condition library-resolution-condition? (library condition-library) (files condition-files)) + (define-condition-type &imported-from &condition + make-imported-from-condition imported-from-condition? + (importing-library importing-library)) + (raise - (condition - (make-error) + (apply condition (make-error) (make-who-condition 'expander) (make-message-condition "cannot locate library in library-path") (make-library-resolution-condition - libname failed-list)))) + libname failed-list) + (map make-imported-from-condition pending-list)))) (define-syntax define-record (syntax-rules () diff --git a/scheme/psyntax.library-manager.ss b/scheme/psyntax.library-manager.ss index 62a47d3..b1835de 100644 --- a/scheme/psyntax.library-manager.ss +++ b/scheme/psyntax.library-manager.ss @@ -141,7 +141,12 @@ (failed-list '())) (cond ((null? ls) - (file-locator-resolution-error x (reverse failed-list))) + (file-locator-resolution-error x + (reverse failed-list) + (let ([ls (external-pending-libraries)]) + (if (null? ls) + (error 'library-manager "BUG") + (cdr ls))))) ((null? exts) (f (cdr ls) (library-extensions) failed-list)) (else