The Trunk: Collections-ul.628.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: Collections-ul.628.mcz

commits-2
Levente Uzonyi uploaded a new version of Collections to project The Trunk:
http://source.squeak.org/trunk/Collections-ul.628.mcz

==================== Summary ====================

Name: Collections-ul.628
Author: ul
Time: 3 May 2015, 2:37:08.318 pm
UUID: 45ec1e72-ea02-42fc-8dcb-10a1dfd22209
Ancestors: Collections-ul.627, Collections-ul.625

Merged Collections-ul.625.

=============== Diff against Collections-ul.627 ===============

Item was changed:
  ----- Method: Character>>asLowercase (in category 'converting') -----
  asLowercase
+ "Answer the receiver's matching lowercase Character."
+
+ value > 255 ifFalse: [
+ | result |
+ (result := (ClassificationTable at: value + 1) bitAnd: 16rFF) > 0
+ ifTrue: [ ^self class value: result ] ].
+ ^self class value: (self encodedCharSet toLowercaseCode: value)!
- "If the receiver is uppercase, answer its matching lowercase Character."
- "A tentative implementation.  Eventually this should consult the Unicode table."
-
- | v |
- v := self charCode.
- (((8r101 <= v and: [v <= 8r132]) or: [16rC0 <= v and: [v <= 16rD6]]) or: [16rD8 <= v and: [v <= 16rDE]])
- ifTrue: [^ Character value: v + 8r40].
- v < 256 ifTrue: [^self].
- ^self class value: ((value < 16r400000
- ifTrue: [Unicode]
- ifFalse: [self encodedCharSet charsetClass])
- toLowercaseCode: v)!

Item was changed:
  ----- Method: Character>>asUppercase (in category 'converting') -----
  asUppercase
+ "Answer the receiver's matching uppercase Character."
+
+ value > 255 ifFalse: [
+ | result |
+ (result := ((ClassificationTable at: value + 1) bitShift: -8) bitAnd: 16rFF) > 0
+ ifTrue: [ ^self class value: result ] ].
+ ^self class value: (self encodedCharSet toUppercaseCode: value)!
- "If the receiver is lowercase, answer its matching uppercase Character."
- "A tentative implementation.  Eventually this should consult the Unicode table."
-
- | v |
- v := self charCode.
- (((8r141 <= v and: [v <= 8r172]) or: [16rE0 <= v and: [v <= 16rF6]]) or: [16rF8 <= v and: [v <= 16rFE]])
- ifTrue: [^ Character value: v - 8r40].
- v < 256 ifTrue: [^self].
- ^self class value: ((value < 16r400000
- ifTrue: [Unicode]
- ifFalse: [self encodedCharSet charsetClass])
- toUppercaseCode: v)!

Item was changed:
  ----- Method: Character>>isAlphaNumeric (in category 'testing') -----
  isAlphaNumeric
  "Answer whether the receiver is a letter or a digit."
 
+ value > 255 ifFalse: [ ^((ClassificationTable at: value + 1) bitAnd: AlphaNumericMask) > 0 ].
  ^self encodedCharSet isAlphaNumeric: self!

Item was changed:
  ----- Method: Character>>isDigit (in category 'testing') -----
  isDigit
 
+ value > 255 ifFalse: [ ^((ClassificationTable at: value + 1) bitAnd: DigitBit) > 0 ].
  ^self encodedCharSet isDigit: self.
  !

Item was changed:
  ----- Method: Character>>isLetter (in category 'testing') -----
  isLetter
 
+ value > 255 ifFalse: [ ^((ClassificationTable at: value + 1) bitAnd: LetterMask) > 0 ].
+ ^self encodedCharSet isLetter: self!
- ^self encodedCharSet isLetter: self.
- !

Item was changed:
  ----- Method: Character>>isLowercase (in category 'testing') -----
  isLowercase
 
+ value > 255 ifFalse: [ ^((ClassificationTable at: value + 1) bitAnd: LowercaseBit) > 0 ].
  ^self encodedCharSet isLowercase: self.
  !

Item was changed:
  ----- Method: Character>>isUppercase (in category 'testing') -----
  isUppercase
 
+ value > 255 ifFalse: [ ^((ClassificationTable at: value + 1) bitAnd: UppercaseBit) > 0 ].
  ^self encodedCharSet isUppercase: self.
  !