Skip to content

Commit

Permalink
Fix token-symbol-thoroughly case conversion, close slime#766
Browse files Browse the repository at this point in the history
  • Loading branch information
kchanqvq committed May 4, 2023
1 parent da5c144 commit ef7f0e7
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions swank.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -1573,7 +1573,7 @@ considered to represent a symbol internal to some current package.)"
:element-type 'character
:fill-pointer 0)))))
(t
(vector-push-extend (casify-char char) token))))
(vector-push-extend char token))))
(unless vertical
(values token package (or (not package) internp)))))

Expand All @@ -1588,15 +1588,17 @@ considered to represent a symbol internal to some current package.)"
(internal-p (cat package-name "::" symbol-name))
(t (cat package-name ":" symbol-name))))

(defun casify-char (char)
"Convert CHAR accoring to readtable-case."
(defun casify-string (string)
"Convert STRING accoring to readtable-case."
(ecase (readtable-case *readtable*)
(:preserve char)
(:upcase (char-upcase char))
(:downcase (char-downcase char))
(:invert (if (upper-case-p char)
(char-downcase char)
(char-upcase char)))))
(:preserve string)
(:upcase (string-upcase string))
(:downcase (string-downcase string))
(:invert (cond ((every #'upper-case-p string)
(string-downcase string))
((every #'lower-case-p string)
(string-upcase string))
(t string)))))


(defun find-symbol-with-status (symbol-name status
Expand Down

0 comments on commit ef7f0e7

Please sign in to comment.