Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions scribble-lib/scribble/contract-render.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@

;; we just take the first one here
(define background-label-p (open-input-string (get-output-string background-label-port)))
(define background-label-line (read-line background-label-p))
(define background-label-line (read-line background-label-p 'any))

(define text-p (the-text-p))
(define-values (before-line _1 _2) (port-next-location text-p))
Expand All @@ -130,7 +130,7 @@
;; the spaces that appear at the ends of the lines
(let ([p (open-input-string (get-output-string block-port))])
(let loop ()
(define l (read-line p))
(define l (read-line p 'any))
(unless (eof-object? l)
(display (regexp-replace #rx" *$" l "") text-p)
(newline text-p)
Expand All @@ -145,9 +145,9 @@

(define (r-blockss+cont blockss mode index-table)
(for* ([blocks (in-list blockss)]
[block (in-list blocks)])
(unless (eq? block 'cont)
(r-block block mode index-table))))
[block (in-list blocks)]
#:unless (eq? block 'cont))
(r-block block mode index-table)))

(define (r-blockss blockss mode index-table)
(for ([blocks (in-list blockss)])
Expand Down
9 changes: 4 additions & 5 deletions scribble-lib/scribble/example.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,10 @@
(attribute no-result-kw)
(attribute no-form-kw))))
(with-syntax ([srcloced-form srcloced-form]
[title (or (attribute title)
(cond
[(= 1 (length (syntax->list #'(form ...))))
#'example-title]
[else #'examples-title]))])
[title (cond
[(attribute title) #t]
[(= 1 (length (syntax->list #'(form ...)))) #'example-title]
[else #'examples-title])])
Comment on lines -97 to +100
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is buggy. If (attribute title) returns a non-#f and non-#t value, this change coerces it to #t.

(syntax/loc stx (as-examples title srcloced-form)))]
[else
srcloced-form]))
Expand Down
11 changes: 5 additions & 6 deletions scribble-lib/scribble/markdown-render.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,11 @@
(regexp-replace #rx"\n$" (get-output-string o) ""))]))
flows))
flowss))
(define widths (map (lambda (col)
(for/fold ([d 0]) ([i (in-list col)])
(if (eq? i 'cont)
0
(apply max d (map string-length i)))))
(apply map list strs)))
(define widths (for/list ([col (in-list (apply map list strs))])
(for/fold ([d 0]) ([i (in-list col)])
(if (eq? i 'cont)
0
(apply max d (map string-length i))))))
(define (x-length col)
(if (eq? col 'cont) 0 (length col)))
(for/fold ([indent? #f]) ([row (in-list strs)])
Expand Down
69 changes: 34 additions & 35 deletions scribble-lib/scribble/search.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,11 @@
(list* (module-path-index->taglet mod)
id
(if suffix (list suffix) null)))
(when (not search-key)
(set! search-key (if unlinked-ok?
(cons #f eb)
eb)))
(unless search-key
(set! search-key
(if unlinked-ok?
(cons #f eb)
eb)))
(define v (and eb (resolve-search search-key part ri `(dep ,eb))))
(define here-result
(and need-result?
Expand Down Expand Up @@ -164,37 +165,35 @@
(hash-set! module-info-cache rmp t)
t)))
(hash-set! seen (cons export-phase rmp) #t)
(let ([a (assq id (let ([a (assoc export-phase exports)])
(if a
(cdr a)
null)))])
(cond
[a
(loop queue
(append (map (lambda (m)
(if (pair? m)
(list (module-path-index-rejoin (car m) mod)
(list-ref m 2)
defn-phase
(list-ref m 1)
(list-ref m 3))
(list (module-path-index-rejoin m mod)
id
defn-phase
import-phase
export-phase)))
(reverse (cadr a)))
rqueue)
need-result?)]
[else
;; A dead end may not be our fault: the files could
;; have changed in inconsistent ways. So just say #f
;; for now.
#;
(error 'find-racket-tag
"dead end when looking for binding source: ~e"
id)
(loop queue rqueue need-result?)]))]
(define a
(assq id
(let ([a (assoc export-phase exports)])
(if a
(cdr a)
null))))
(cond
[a
(loop queue
(append (map (lambda (m)
(if (pair? m)
(list (module-path-index-rejoin (car m) mod)
(list-ref m 2)
defn-phase
(list-ref m 1)
(list-ref m 3))
(list (module-path-index-rejoin m mod)
id
defn-phase
import-phase
export-phase)))
(reverse (cadr a)))
rqueue)
need-result?)]
;; A dead end may not be our fault: the files could
;; have changed in inconsistent ways. So just say #f
;; for now.
#;(error 'find-racket-tag "dead end when looking for binding source: ~e" id)
[else (loop queue rqueue need-result?)])]
[else
;; Can't get the module source, so continue with queue:
(loop queue rqueue need-result?)]))
Expand Down
Loading
Loading