Changeset 16485


Ignore:
Timestamp:
Jul 20, 2015, 2:47:10 AM (4 years ago)
Author:
svspire
Message:

Hemlock no longer interns symbols indiscriminately during symbol coloring.
Fixes ticket:1246.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/cocoa-ide/hemlock/src/display.lisp

    r16446 r16485  
    194194    (coloring-cache-data cache)))
    195195
    196 
    197 ;; Map strings to symbols, to avoid consing strings for upcasing
    198 (defvar *string-to-symbol-cache* (make-hash-table :test #'equalp))
    199 
    200196(defun case-insensitive-string-to-symbol (string pkg)
    201197  (when (null pkg) (setq pkg *package*))
    202   (let* ((pkg-alist (gethash string *string-to-symbol-cache*))
    203          (known (assoc pkg pkg-alist)))
    204     (if known
    205       (cdr known)
    206       (let* ((str (coerce string 'simple-string))
    207              (*package* pkg)
    208              (*read-eval* nil)
    209              (sym (ignore-errors (read-from-string str))))
    210         (unless (symbolp sym) (setq sym nil))
    211         (setf (gethash str *string-to-symbol-cache*) (cons (cons pkg sym) pkg-alist))
    212         sym))))
    213 
     198  (let* ((str (coerce string 'simple-string)))
     199    (ignore-errors
     200     (case (readtable-case *readtable*)
     201       (:upcase (find-symbol (nstring-upcase str) pkg))
     202       (:downcase (find-symbol (nstring-downcase str) pkg))
     203       (:preserve (find-symbol str pkg))
     204       (t (find-symbol (nstring-upcase str) pkg)
     205          ; not the right way to handle :invert. Do we care?
     206          )))))
    214207
    215208;; Try to exclude use of symbol in data.
Note: See TracChangeset for help on using the changeset viewer.