/[cmucl]/src/code/string.lisp
ViewVC logotype

Diff of /src/code/string.lisp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.12.30.17 by rtoy, Tue May 19 20:36:28 2009 UTC revision 1.12.30.18 by rtoy, Wed May 20 16:30:08 2009 UTC
# Line 412  Line 412 
412                     (return (- index1 offset1))                     (return (- index1 offset1))
413                     (return ()))))))))                     (return ()))))))))
414    
415    ;; Convert to lowercase for case folding, to match what Unicode
416    ;; CaseFolding.txt says.  An example where this matters: U+1E9E maps
417    ;; to U+00DF.  But the uppercase version of U+00DF is U+00DF.
418  #+unicode  #+unicode
419  (defmacro equal-char-codepoint (codepoint)  (defmacro equal-char-codepoint (codepoint)
420    `(let ((ch ,codepoint))    `(let ((ch ,codepoint))
421       (if (< 96 ch 123)       ;; Handle ASCII separately for bootstrapping and for unidata missing.
422           (- ch 32)       (if (< 64 ch 91)
423             (+ ch 32)
424           #-(and unicode (not unicode-bootstrap))           #-(and unicode (not unicode-bootstrap))
425           ch           ch
426           #+(and unicode (not unicode-bootstrap))           #+(and unicode (not unicode-bootstrap))
427           (if (> ch 127) (unicode-upper ch) ch))))           (if (> ch 127) (unicode-lower ch) ch))))
428    
429  #+unicode  #+unicode
430  (defmacro string-less-greater-equal (lessp equalp)  (defmacro string-less-greater-equal (lessp equalp)
# Line 440  Line 444 
444             (declare (fixnum index1 index2))             (declare (fixnum index1 index2))
445             (multiple-value-bind (char1 wide1)             (multiple-value-bind (char1 wide1)
446                 (codepoint string1 index1)                 (codepoint string1 index1)
447                 (declare (type (integer 0 #x10ffff) char1))
448               (multiple-value-bind (char2 wide2)               (multiple-value-bind (char2 wide2)
449                   (codepoint string2 index2)                   (codepoint string2 index2)
450                 (if (= (equal-char-codepoint char1)                 (declare (type (integer 0 #x10ffff) char2))
451                        (equal-char-codepoint char2))                 (setf char1 (equal-char-codepoint char1))
452                   (setf char2 (equal-char-codepoint char2))
453                   (if (= char1 char2)
454                     (progn                     (progn
455                       (when wide1 (incf index1))                       (when wide1 (incf index1))
456                       (when wide2 (incf index2)))                       (when wide2 (incf index2)))

Legend:
Removed from v.1.12.30.17  
changed lines
  Added in v.1.12.30.18

  ViewVC Help
Powered by ViewVC 1.1.5