From 5145dd3aa0c02c9fc496d1432fc4410674206e1d Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Mon, 20 Feb 2017 00:05:31 -0800 Subject: Import Upstream version 3a2 --- top-refs.scm | 48 ++++++++++++++++++++++++++---------------------- 1 file changed, 26 insertions(+), 22 deletions(-) (limited to 'top-refs.scm') diff --git a/top-refs.scm b/top-refs.scm index 29e25dc..3647dc4 100644 --- a/top-refs.scm +++ b/top-refs.scm @@ -74,12 +74,13 @@ (define (top-refs:include filename) (cond ((not (and (string? filename) (file-exists? filename))) (top-refs:warn 'top-refs:include 'skipping filename)) - (else (fluid-let ((*load-pathname* filename)) - (call-with-input-file filename - (lambda (port) - (do ((exp (read port) (read port))) - ((eof-object? exp)) - (top-refs:top-level exp)))))))) + (else (call-with-input-file filename + (lambda (port) + (with-load-pathname filename + (lambda () + (do ((exp (read port) (read port))) + ((eof-object? exp)) + (top-refs:top-level exp))))))))) (define (top-refs:top-level exp) (cond ((not (and (pair? exp) (list? exp))) @@ -238,7 +239,7 @@ ;;@dots{} (info) indexes of @1. The identifiers have the case that ;;the implementation's @code{read} uses for symbols. Identifiers ;;containing spaces (eg. @code{close-base on base-table}) are -;;@emph{not} included. +;;@emph{not} included. #f is returned if the index is not found. ;; ;;Each info index is headed by a @samp{* Menu:} line. To list the ;;symbols in the first and third info indexes do: @@ -266,20 +267,23 @@ (do ((line (read-line port) (read-line port))) ((or (eof-object? line) (not (and (> (string-length line) 5) - (string=? "* " (substring line 0 2))))) + (or (string=? "* " (substring line 0 2)) + (substring? "(line " line))))) (loop (read-line port) (+ 1 iidx) (cdr ndxs))) - (let (( (substring? " <" line))) - (define csi (or (and - (> (string-length line) (+ 3 )) - (string-index - "0123456789" - (string-ref line (+ 2 ))) - ) - (substring? ": " line))) - (and - csi - (let ((str (substring line 2 csi))) - (if (and (not (substring? " " str)) - (not (memq (string-ci->symbol str) exports))) - (set! exports (cons (string-ci->symbol str) exports)))))))) + (and + (string=? "* " (substring line 0 2)) + (let (( (substring? " <" line))) + (define csi (or (and + (> (string-length line) (+ 3 )) + (string-index + "0123456789" + (string-ref line (+ 2 ))) + ) + (substring? ": " line))) + (and + csi + (let ((str (substring line 2 csi))) + (if (and (not (substring? " " str)) + (not (memq (string-ci->symbol str) exports))) + (set! exports (cons (string-ci->symbol str) exports))))))))) (else (loop (read-line port) (+ 1 iidx) ndxs)))))))) -- cgit v1.2.3