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 02504c9
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions swank.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -1573,9 +1573,9 @@ 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)))))
(values (casify-string token) (casify-string package) (or (not package) internp)))))

(defun untokenize-symbol (package-name internal-p symbol-name)
"The inverse of TOKENIZE-SYMBOL.
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 02504c9

Please sign in to comment.