From 7e4eb6a57894481bee6d0982751eada165a1f6a4 Mon Sep 17 00:00:00 2001 From: Nikodemus Siivola Date: Fri, 15 Oct 2010 09:52:58 +0000 Subject: [PATCH] 1.0.43.61: teach docstrings.lisp about parentheses Kludge to get things like (SIMPLE-ARRAY T (3)) right in docstrings. Also document SB-EXT:GET-TIME-OF-DAY and SB-EXT:SEED-RANDOM-STATE. --- doc/manual/beyond-ansi.texinfo | 2 ++ doc/manual/docstrings.lisp | 24 ++++++++++++++++++++---- version.lisp-expr | 2 +- 3 files changed, 23 insertions(+), 5 deletions(-) diff --git a/doc/manual/beyond-ansi.texinfo b/doc/manual/beyond-ansi.texinfo index 149ec8a..e2858f6 100644 --- a/doc/manual/beyond-ansi.texinfo +++ b/doc/manual/beyond-ansi.texinfo @@ -408,6 +408,8 @@ arguments to @code{make-hash-table}. @section Miscellaneous Extensions @include fun-sb-ext-array-storage-vector.texinfo +@include fun-sb-ext-get-time-of-day.texinfo +@include fun-sb-ext-seed-random-state.texinfo @node Stale Extensions @comment node-name, next, previous, up diff --git a/doc/manual/docstrings.lisp b/doc/manual/docstrings.lisp index 958895b..67dc0d1 100644 --- a/doc/manual/docstrings.lisp +++ b/doc/manual/docstrings.lisp @@ -444,19 +444,25 @@ with #\@. Optionally downcase the result." ;;; line markups -(defvar *not-symbols* '("ANSI" "CLHS")) +(defvar *not-symbols* '("ANSI" "CLHS" "UNIX")) (defun locate-symbols (line) "Return a list of index pairs of symbol-like parts of LINE." ;; This would be a good application for a regex ... (let (result) (flet ((grab (start end) - (unless (member (subseq line start end) '("ANSI" "CLHS")) - (push (list start end) result)))) + (unless (member (subseq line start end) *not-symbols*) + (push (list start end) result))) + (got-symbol-p (start) + (let ((end (when (< start (length line)) + (position #\space line :start start)))) + (when end + (every (lambda (char) (find char *symbol-characters*)) + (subseq line start end)))))) (do ((begin nil) (maybe-begin t) (i 0 (1+ i))) - ((= i (length line)) + ((>= i (length line)) ;; symbol at end of line (when (and begin (or (> i (1+ begin)) (not (member (char line begin) '(#\A #\I))))) @@ -479,6 +485,16 @@ with #\@. Optionally downcase the result." ((find (char line i) *symbol-delimiters*) ;; potential symbol begin after this position (setf maybe-begin t)) + ((and (eql #\( (char line i)) (got-symbol-p (1+ i))) + ;; a type designator, or a function call as part of the text? + (multiple-value-bind (exp end) + (let ((*package* (find-package :cl-user))) + (ignore-errors (read-from-string line nil nil :start i))) + (when exp + (grab i end) + (setf begin nil + maybe-begin nil + i end)))) (t ;; Not reading a symbol, not at potential start of symbol (setf maybe-begin nil))))))) diff --git a/version.lisp-expr b/version.lisp-expr index 8ee4fe3..7341f52 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -17,4 +17,4 @@ ;;; checkins which aren't released. (And occasionally for internal ;;; versions, especially for internal versions off the main CVS ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".) -"1.0.43.60" +"1.0.43.61" -- 1.7.10.4