Permalink
Browse files

Correct Help Desk Search so it handles keywords and hash-colon-keywor…

…d lexemes.

Closes PR 13470.
  • Loading branch information...
1 parent 49ab87e commit 61ddb91815d06f3f71d45fb6819e3bfece84ad7b @dyoo committed Feb 11, 2013
Showing with 10 additions and 7 deletions.
  1. +10 −7 collects/drracket/private/unit.rkt
@@ -267,13 +267,16 @@ module browser threading seems wrong.
;; find-searchable-tokens : number number -> (or/c #f (list symbol number number))
(define (find-searchable-tokens start end)
(define tokens (get-tokens start end))
- (define raw-tokens (map (λ (x) (list-ref x 0)) tokens))
- (cond
- [(equal? raw-tokens '(symbol))
- (car tokens)]
- [(equal? raw-tokens '(constant symbol))
- (cadr tokens)]
- [else #f]))
+ (for/or ([tok tokens])
+ (define type (list-ref tok 0))
+ (cond [(or (eq? type 'symbol)
+ (eq? type 'hash-colon-keyword)
+ ;; The token may have been categorized as a keyword due to
+ ;; its presence in the tabification preferences:
+ (eq? type 'keyword))
+ tok]
+ [else
+ #f])))
(define searchable-token
(or (and before before+

0 comments on commit 61ddb91

Please sign in to comment.