1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-03 05:20:16 +02:00

merge from 1.8 branch

This commit is contained in:
Kevin Ryde 2006-06-17 22:53:04 +00:00
parent 9a9931719d
commit 5be9f7290b
20 changed files with 39 additions and 15 deletions

View file

@ -90,14 +90,21 @@
;;
;; commentary extraction
;;
(define default-in-line-re (make-regexp "^;;; Commentary:"))
(define default-after-line-re (make-regexp "^;;; Code:"))
(define default-scrub (let ((dirt (make-regexp "^;+")))
(lambda (line)
(let ((m (regexp-exec dirt line)))
(if m (match:suffix m) line)))))
(define (file-commentary filename . cust) ; (IN-LINE-RE AFTER-LINE-RE SCRUB)
;; These are constants but are not at the top level because the repl in
;; boot-9.scm loads session.scm which in turn loads this file, and we want
;; that to work even even when regexps are not available (ie. make-regexp
;; doesn't exist), as for instance is the case on mingw.
;;
(define default-in-line-re (make-regexp "^;;; Commentary:"))
(define default-after-line-re (make-regexp "^;;; Code:"))
(define default-scrub (let ((dirt (make-regexp "^;+")))
(lambda (line)
(let ((m (regexp-exec dirt line)))
(if m (match:suffix m) line)))))
;; fixme: might be cleaner to use optargs here...
(let ((in-line-re (if (> 1 (length cust))
default-in-line-re