author | Claus Gittinger <cg@exept.de> |
Thu, 27 Jun 2019 16:34:40 +0200 | |
changeset 24379 | 852be153b0ec |
parent 24296 | 61c0d93e30da |
child 24444 | bcff47993be2 |
permissions | -rw-r--r-- |
23950 | 1 |
"{ Encoding: utf8 }" |
2 |
||
1 | 3 |
" |
5 | 4 |
COPYRIGHT (c) 1988 by Claus Gittinger |
154 | 5 |
All Rights Reserved |
1 | 6 |
|
7 |
This software is furnished under a license and may be used |
|
8 |
only in accordance with the terms of that license and with the |
|
9 |
inclusion of the above copyright notice. This software may not |
|
10 |
be provided or otherwise made available to, or used by, any |
|
11 |
other person. No title to or ownership of the software is |
|
12 |
hereby transferred. |
|
13 |
" |
|
5407 | 14 |
"{ Package: 'stx:libbasic' }" |
15 |
||
17346 | 16 |
"{ NameSpace: Smalltalk }" |
17 |
||
1 | 18 |
Magnitude subclass:#Character |
995
b018368b3a94
asString to 16-bit char should return a twoByteString
Claus Gittinger <cg@exept.de>
parents:
819
diff
changeset
|
19 |
instanceVariableNames:'asciivalue' |
22000 | 20 |
classVariableNames:'CharacterTable Separators BOMCharacter' |
995
b018368b3a94
asString to 16-bit char should return a twoByteString
Claus Gittinger <cg@exept.de>
parents:
819
diff
changeset
|
21 |
poolDictionaries:'' |
b018368b3a94
asString to 16-bit char should return a twoByteString
Claus Gittinger <cg@exept.de>
parents:
819
diff
changeset
|
22 |
category:'Magnitude-General' |
1 | 23 |
! |
24 |
||
2124 | 25 |
!Character class methodsFor:'documentation'! |
54 | 26 |
|
88 | 27 |
copyright |
28 |
" |
|
29 |
COPYRIGHT (c) 1988 by Claus Gittinger |
|
154 | 30 |
All Rights Reserved |
88 | 31 |
|
32 |
This software is furnished under a license and may be used |
|
33 |
only in accordance with the terms of that license and with the |
|
34 |
inclusion of the above copyright notice. This software may not |
|
35 |
be provided or otherwise made available to, or used by, any |
|
36 |
other person. No title to or ownership of the software is |
|
37 |
hereby transferred. |
|
38 |
" |
|
39 |
! |
|
40 |
||
54 | 41 |
documentation |
42 |
" |
|
1491
a42ae3fbb756
fixed asLowercase / asUppercase for national characters
Claus Gittinger <cg@exept.de>
parents:
1295
diff
changeset
|
43 |
This class represents characters. |
7897 | 44 |
|
1491
a42ae3fbb756
fixed asLowercase / asUppercase for national characters
Claus Gittinger <cg@exept.de>
parents:
1295
diff
changeset
|
45 |
Notice, that actual character objects are not used when characters |
17249 | 46 |
are stored in strings, symbols etc. |
47 |
These only store a character's asciiValue/codePoint for a more compact representation. |
|
1491
a42ae3fbb756
fixed asLowercase / asUppercase for national characters
Claus Gittinger <cg@exept.de>
parents:
1295
diff
changeset
|
48 |
The word 'asciiValue' is a historic leftover - actually, any integer |
8028 | 49 |
code is allowed and actually used (i.e. characters are not limited to 8bit). |
17249 | 50 |
Also, the encoding is actually Unicode, of which ascii is a subset and the same encoding value |
51 |
for the first 128 characters (codePoint 0 to 127 are the same in ascii). |
|
52 |
||
18215 | 53 |
Some heavily used Characters are kept as singletons; i.e. for every asciiValue (0..N), |
17249 | 54 |
there exists exactly one instance of Character, which is shared. |
55 |
Character value:xxx checks for this, and returns a reference to an existing instance. |
|
56 |
For N<=255, this is guaranteed; i.e. in all Smalltalks, the single byte characters are always |
|
57 |
handled like this, and you can therefore safely compare them using == (identity compare). |
|
58 |
||
59 |
Other characters (i.e. codepoint > N) are not guaranteed to be shared; |
|
18215 | 60 |
i.e. these my or may not be created as required. |
17249 | 61 |
Actually, do NOT depend on which characters are and which are not shared. |
62 |
Always compare using #= if there is any chance of a non-ascii character being involved. |
|
63 |
||
64 |
Once again (because beginners sometimes make this mistake): |
|
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
65 |
This means: you may compare characters using #== ONLY IFF you are certain, |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
66 |
that the characters ranges is 0..255. |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
67 |
Otherwise, you HAVE TO compare using #=. (if in doubt, always compare using #=). |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
68 |
Sorry for this inconvenience, but it is (practically) impossible to keep |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
69 |
the possible maximum of 2^32 characters (Unicode) around, for that convenience alone. |
17249 | 70 |
|
71 |
In ST/X, N is (currently) 1024. This means that all the latin characters and some others are |
|
72 |
kept as singleton in the CharacterTable class variable (which is also used by the VM when characters |
|
20088 | 73 |
are instantiated). |
357 | 74 |
|
68 | 75 |
Methods marked as (JS) come from the manchester Character goody |
76 |
(CharacterComparing) by Jan Steinman, which allow Characters to be used as |
|
9153 | 77 |
Interval elements (i.e. ($a to:$z) do:[...] ); |
1229 | 78 |
They are not a big deal, but convenient add-ons. |
79 |
Some of these have been modified a bit. |
|
1 | 80 |
|
68 | 81 |
WARNING: characters are known by compiler and runtime system - |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
82 |
do not change the instance layout. |
357 | 83 |
|
84 |
Also, although you can create subclasses of Character, the compiler always |
|
85 |
creates instances of Character for literals ... |
|
814
d4d28ca7afcd
made the global CharacterTable a classVar of Character
Claus Gittinger <cg@exept.de>
parents:
760
diff
changeset
|
86 |
... and other classes are hard-wired to always return instances of characters |
357 | 87 |
in some cases (i.e. String>>at:, Symbol>>at: etc.). |
88 |
Therefore, it may not make sense to create a character-subclass. |
|
1295 | 89 |
|
8028 | 90 |
Case Mapping in Unicode: |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
91 |
There are a number of complications to case mappings that occur once the repertoire |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
92 |
of characters is expanded beyond ASCII. |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
93 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
94 |
* Because of the inclusion of certain composite characters for compatibility, |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
95 |
such as U+01F1 'DZ' capital dz, there is a third case, called titlecase, |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
96 |
which is used where the first letter of a word is to be capitalized |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
97 |
(e.g. Titlecase, vs. UPPERCASE, or lowercase). |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
98 |
For example, the title case of the example character is U+01F2 'Dz' capital d with small z. |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
99 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
100 |
* Case mappings may produce strings of different length than the original. |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
101 |
For example, the German character U+00DF small letter sharp s expands when uppercased to |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
102 |
the sequence of two characters 'SS'. |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
103 |
This also occurs where there is no precomposed character corresponding to a case mapping. |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
104 |
*** This is not yet implemented (in 5.2) *** |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
105 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
106 |
* Characters may also have different case mappings, depending on the context. |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
107 |
For example, U+03A3 capital sigma lowercases to U+03C3 small sigma if it is not followed |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
108 |
by another letter, but lowercases to 03C2 small final sigma if it is. |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
109 |
*** This is not yet implemented (in 5.2) *** |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
110 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
111 |
* Characters may have case mappings that depend on the locale. |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
112 |
For example, in Turkish the letter 0049 'I' capital letter i lowercases to 0131 small dotless i. |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
113 |
*** This is not yet implemented (in 5.2) *** |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
114 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
115 |
* Case mappings are not, in general, reversible. |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
116 |
For example, once the string 'McGowan' has been uppercased, lowercased or titlecased, |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
117 |
the original cannot be recovered by applying another uppercase, lowercase, or titlecase operation. |
8028 | 118 |
|
119 |
Collation Sequence: |
|
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
120 |
*** This is not yet implemented (in 5.2) *** |
8028 | 121 |
|
1295 | 122 |
[author:] |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
123 |
Claus Gittinger |
1295 | 124 |
|
125 |
[see also:] |
|
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
126 |
String TwoByteString Unicode16String Unicode32String |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
127 |
StringCollection Text |
54 | 128 |
" |
129 |
! ! |
|
1 | 130 |
|
2124 | 131 |
!Character class methodsFor:'instance creation'! |
1 | 132 |
|
133 |
basicNew |
|
134 |
"catch new - Characters cannot be created with new" |
|
135 |
||
136 |
^ self error:'Characters cannot be created with new' |
|
137 |
! |
|
138 |
||
10936
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
139 |
codePoint:anInteger |
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
140 |
"return a character with codePoint anInteger" |
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
141 |
|
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
142 |
%{ /* NOCONTEXT */ |
18240
28af09029a8b
ifdef for SCHTEAM engine changed (not relevant for ST/X)
Claus Gittinger <cg@exept.de>
parents:
18215
diff
changeset
|
143 |
#ifdef __SCHTEAM__ |
18215 | 144 |
{ |
22002 | 145 |
char ch = (char)(context.stArg(0).intValue("[codePoint:]")); |
146 |
||
147 |
return context._RETURN(STCharacter._new(ch)); |
|
18215 | 148 |
} |
149 |
/* NOTREACHED */ |
|
150 |
#else |
|
10936
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
151 |
INT __codePoint; |
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
152 |
|
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
153 |
if (__isSmallInteger(anInteger)) { |
22002 | 154 |
__codePoint = ( __smallIntegerVal(anInteger) ); |
155 |
if ((unsigned INT)(__codePoint) <= MAX_IMMEDIATE_CHARACTER /* (__codePoint >= 0) && (__codePoint <= 255) */) { |
|
156 |
RETURN ( __MKCHARACTER(__codePoint) ); |
|
157 |
} |
|
10936
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
158 |
} |
18215 | 159 |
#endif |
10936
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
160 |
%}. |
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
161 |
(anInteger between:0 and:(CharacterTable size - 1)) ifTrue:[ |
22002 | 162 |
^ CharacterTable at:(anInteger + 1) |
10936
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
163 |
]. |
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
164 |
(anInteger between:16r100 and:16r3FFFFFFF) ifTrue:[ |
22002 | 165 |
(anInteger = 16rFEFF) ifTrue:[^ self byteOrderMark]. |
166 |
^ super basicNew setCodePoint:anInteger |
|
10936
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
167 |
]. |
22002 | 168 |
|
10936
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
169 |
" |
22002 | 170 |
a character's codePoint must be 0..16r3FFFFFFF. |
171 |
(i.e. only characters with up-to 30 bits are allowed, |
|
172 |
which is way more than needed...) |
|
10936
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
173 |
" |
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
174 |
RangeError raiseWith:anInteger errorString:'invalid codePoint for character' |
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
175 |
|
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
176 |
" |
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
177 |
self codePoint:16r34. |
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
178 |
self codePoint:16r3455. |
22002 | 179 |
(self codePoint:16rFEFF) == (self codePoint:16rFEFF). |
10936
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
180 |
self codePoint:16rFFFFFFFFFFFFFFFFFFF. |
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
181 |
" |
22002 | 182 |
|
183 |
"Modified (comment): / 13-07-2017 / 12:18:14 / cg" |
|
10936
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
184 |
! |
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
185 |
|
699 | 186 |
digitValue:anInteger |
187 |
"return a character that corresponds to anInteger. |
|
188 |
0-9 map to $0-$9, 10-35 map to $A-$Z" |
|
189 |
||
190 |
|val "{ Class: SmallInteger }" | |
|
191 |
||
192 |
val := anInteger. |
|
193 |
(val between:0 and:9) ifTrue:[ |
|
10936
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
194 |
^ Character codePoint:(val + ($0 codePoint)) |
699 | 195 |
]. |
196 |
(val between:10 and:35) ifTrue:[ |
|
10936
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
197 |
^ Character codePoint:(val + ($A codePoint - 10)) |
699 | 198 |
]. |
10936
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
199 |
^ self error:'value not in range 0 to 35' |
699 | 200 |
! |
201 |
||
6808 | 202 |
utf8DecodeFrom:aStream |
22409 | 203 |
"read and return a single unicode character from an UTF8 encoded stream. |
204 |
Answer nil, if Stream>>#next answers nil." |
|
6808 | 205 |
|
22412 | 206 |
|fetchNext c1 c2 codePoint "{ Class:SmallInteger }"| |
6808 | 207 |
|
208 |
c1 := aStream next. |
|
22409 | 209 |
c1 isNil ifTrue:[ |
210 |
^ nil. |
|
211 |
]. |
|
10936
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
212 |
codePoint := c1 codePoint. |
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
213 |
codePoint <= 16r7F ifTrue:[ |
22409 | 214 |
"/ 0xxxxxxx - 7 bits |
215 |
^ c1 asCharacter. |
|
6808 | 216 |
]. |
217 |
||
10936
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
218 |
(codePoint bitAnd:2r11000000) == 2r10000000 ifTrue:[ |
22409 | 219 |
"/ out of sync (got an intermediate character) |
220 |
InvalidEncodingError raiseRequestWith:codePoint errorString:' - out of sync'. |
|
221 |
^ c1 asCharacter. |
|
6808 | 222 |
]. |
223 |
||
22412 | 224 |
fetchNext := [ |code "{ Class:SmallInteger }"| |
22409 | 225 |
code := aStream next codePoint. |
226 |
(code bitAnd:2r11000000) == 2r10000000 ifFalse:[ |
|
227 |
"/ followup chars must have 2r10 in high bits |
|
22412 | 228 |
InvalidEncodingError raiseRequestWith:code errorString:' - utf8: bad followup character'. |
22409 | 229 |
^ c1 asCharacter. |
230 |
]. |
|
231 |
code bitAnd:16r3F |
|
232 |
]. |
|
6808 | 233 |
|
10936
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
234 |
(codePoint bitAnd:2r11100000) == 2r11000000 ifTrue:[ |
22409 | 235 |
"/ 110xxxxx 10xxxxxx - 11 bits |
236 |
codePoint := codePoint bitAnd:16r1F. |
|
237 |
codePoint := (codePoint bitShift:6) bitOr:(fetchNext value). |
|
238 |
codePoint <= 16r7F ifTrue:[ |
|
239 |
InvalidEncodingError raiseRequestWith:codePoint. |
|
240 |
]. |
|
241 |
^ Character codePoint:codePoint |
|
6808 | 242 |
]. |
10936
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
243 |
(codePoint bitAnd:2r11110000) == 2r11100000 ifTrue:[ |
22409 | 244 |
"/ 1110xxxx 10xxxxxx 10xxxxxx - 16 bits |
245 |
codePoint := codePoint bitAnd:16r0F. |
|
246 |
codePoint := (codePoint bitShift:6) bitOr:(fetchNext value). |
|
247 |
codePoint := (codePoint bitShift:6) bitOr:(fetchNext value). |
|
248 |
codePoint <= 16r7FF ifTrue:[ |
|
249 |
InvalidEncodingError raiseRequestWith:codePoint. |
|
250 |
]. |
|
251 |
^ Character codePoint:codePoint |
|
6808 | 252 |
]. |
253 |
||
10936
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
254 |
(codePoint bitAnd:2r11111000) == 2r11110000 ifTrue:[ |
22409 | 255 |
"/ 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx - 21 bits |
256 |
codePoint := codePoint bitAnd:16r07. |
|
257 |
codePoint := (codePoint bitShift:6) bitOr:(fetchNext value). |
|
258 |
codePoint := (codePoint bitShift:6) bitOr:(fetchNext value). |
|
259 |
codePoint := (codePoint bitShift:6) bitOr:(fetchNext value). |
|
260 |
codePoint <= 16rFFFF ifTrue:[ |
|
261 |
InvalidEncodingError raiseRequestWith:codePoint. |
|
262 |
]. |
|
263 |
^ Character codePoint:codePoint |
|
6808 | 264 |
]. |
265 |
||
10936
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
266 |
(codePoint bitAnd:2r11111100) == 2r11111000 ifTrue:[ |
22409 | 267 |
"/ 111110xx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx - 26 bits |
268 |
codePoint := codePoint bitAnd:16r03. |
|
269 |
codePoint := (codePoint bitShift:6) bitOr:(fetchNext value). |
|
270 |
codePoint := (codePoint bitShift:6) bitOr:(fetchNext value). |
|
271 |
codePoint := (codePoint bitShift:6) bitOr:(fetchNext value). |
|
272 |
codePoint := (codePoint bitShift:6) bitOr:(fetchNext value). |
|
273 |
codePoint <= 16r1FFFFF ifTrue:[ |
|
274 |
InvalidEncodingError raiseRequestWith:codePoint. |
|
275 |
]. |
|
276 |
^ Character codePoint:codePoint |
|
6808 | 277 |
]. |
278 |
||
10936
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
279 |
(codePoint bitAnd:2r11111110) == 2r11111100 ifTrue:[ |
22409 | 280 |
"/ 1111110x ... 10xxxxxx - any number of bits |
281 |
codePoint := codePoint bitAnd:16r01. |
|
282 |
||
283 |
c2 := aStream peek. |
|
284 |
[c2 notNil and:[(c2 codePoint bitAnd:2r11000000) == 2r10000000]] whileTrue:[ |
|
285 |
codePoint := (codePoint bitShift:6) bitOr:(c2 codePoint bitAnd:16r3F). |
|
286 |
aStream next. |
|
287 |
c2 := aStream peek. |
|
288 |
]. |
|
289 |
codePoint <= 16r3FFFFFF ifTrue:[ |
|
290 |
InvalidEncodingError raiseRequestWith:codePoint. |
|
291 |
]. |
|
292 |
^ Character codePoint:codePoint |
|
6808 | 293 |
]. |
294 |
||
11325
b2ba4174deb8
Raise InvalidEncodingError when utf8 decode fails
Stefan Vogel <sv@exept.de>
parents:
11321
diff
changeset
|
295 |
InvalidEncodingError raiseRequestWith:codePoint. |
18605 | 296 |
^ c1 asCharacter. |
6808 | 297 |
|
298 |
" |
|
9153 | 299 |
Character utf8DecodeFrom:'a' readStream |
300 |
Character utf8DecodeFrom:#[195 188] asString readStream |
|
301 |
" |
|
6808 | 302 |
|
303 |
"test: |
|
304 |
||
305 |
|utf8Encoding original readBack| |
|
306 |
||
22412 | 307 |
1 to:16r3fFFFF do:[:codePoint | |
22409 | 308 |
original := Character value:codePoint. |
309 |
utf8Encoding := original utf8Encoded. |
|
310 |
readBack := Character utf8DecodeFrom:(utf8Encoding readStream). |
|
311 |
readBack codePoint = codePoint ifFalse:[ |
|
312 |
self halt |
|
313 |
] |
|
6808 | 314 |
] |
315 |
" |
|
22409 | 316 |
|
22412 | 317 |
"Modified: / 10-01-2018 / 22:53:31 / stefan" |
6808 | 318 |
! |
319 |
||
1 | 320 |
value:anInteger |
10936
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
321 |
"return a character with codePoint anInteger - backward compatibility" |
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
322 |
|
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
323 |
^ self codePoint:anInteger |
5945 | 324 |
! ! |
325 |
||
23852 | 326 |
|
2214 | 327 |
!Character class methodsFor:'accessing untypeable characters'! |
328 |
||
15689 | 329 |
controlCharacter:char |
330 |
"Answer the Character representing ctrl-char. |
|
331 |
ctrl-a -> 1; ctrl-@ -> 0" |
|
332 |
||
21864 | 333 |
|lcChar| |
334 |
||
335 |
char == $@ ifTrue:[^ Character value:0 ]. |
|
336 |
||
337 |
lcChar := char asUppercase. |
|
338 |
self assert:(lcChar between:$A and:$Z+5). |
|
339 |
^ self codePoint:(lcChar - $A + 1) |
|
15689 | 340 |
|
341 |
" |
|
21864 | 342 |
self controlCharacter:$@ -> 0 |
343 |
self controlCharacter:$a -> 1 |
|
344 |
self controlCharacter:$d -> 4 |
|
345 |
self controlCharacter:$z -> 26 |
|
346 |
self controlCharacter:$[ -> 27 |
|
347 |
self controlCharacter:$\ -> 28 |
|
348 |
self controlCharacter:$] -> 29 |
|
349 |
self controlCharacter:$_ -> 31 |
|
15689 | 350 |
" |
21864 | 351 |
|
352 |
"Modified (comment): / 20-06-2017 / 17:20:21 / cg" |
|
15689 | 353 |
! |
354 |
||
2214 | 355 |
endOfInput |
11144 | 356 |
"Answer the Character representing ctrl-d (Unix-EOF)." |
9153 | 357 |
|
10936
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
358 |
^ self codePoint:4 |
2214 | 359 |
! |
360 |
||
361 |
leftParenthesis |
|
8097 | 362 |
"Answer the Character representing a left parenthesis." |
9153 | 363 |
|
10936
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
364 |
^ self codePoint:40 |
2214 | 365 |
! |
366 |
||
367 |
period |
|
8097 | 368 |
"Answer the Character representing a carriage period." |
9153 | 369 |
|
10936
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
370 |
^ self codePoint:46 |
2214 | 371 |
! |
372 |
||
373 |
poundSign |
|
11144 | 374 |
"Answer the Character representing a pound sign (hash)." |
9153 | 375 |
|
10936
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
376 |
^ self codePoint:35 |
2214 | 377 |
! |
378 |
||
379 |
rightParenthesis |
|
8097 | 380 |
"Answer the Character representing a right parenthesis." |
9153 | 381 |
|
10936
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
382 |
^ self codePoint:41 |
2214 | 383 |
! ! |
384 |
||
23852 | 385 |
|
2124 | 386 |
!Character class methodsFor:'constants'! |
699 | 387 |
|
388 |
backspace |
|
389 |
"return the backspace character" |
|
390 |
||
10936
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
391 |
^ Character codePoint:8 |
699 | 392 |
! |
393 |
||
394 |
bell |
|
395 |
"return the bell character" |
|
396 |
||
10936
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
397 |
^ Character codePoint:7 |
699 | 398 |
! |
399 |
||
22000 | 400 |
byteOrderMark |
22002 | 401 |
"the unicode BOM character as a singleton" |
22000 | 402 |
|
403 |
BOMCharacter isNil ifTrue:[ |
|
22018 | 404 |
BOMCharacter := super basicNew setCodePoint:16rFEFF |
22000 | 405 |
]. |
406 |
^ BOMCharacter |
|
407 |
||
22002 | 408 |
" |
409 |
self byteOrderMark |
|
22018 | 410 |
self codePoint:16rFEFF |
22002 | 411 |
" |
412 |
||
22000 | 413 |
"Created: / 13-07-2017 / 12:04:34 / cg" |
22018 | 414 |
"Modified (comment): / 14-07-2017 / 15:22:14 / cg" |
22000 | 415 |
! |
416 |
||
699 | 417 |
cr |
9153 | 418 |
"return the lineEnd character |
699 | 419 |
- actually (in unix) this is a newline character" |
420 |
||
10936
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
421 |
^ Character codePoint:10 |
699 | 422 |
! |
423 |
||
9153 | 424 |
del |
699 | 425 |
"return the delete character" |
426 |
||
10936
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
427 |
^ Character codePoint:16r7F |
699 | 428 |
! |
429 |
||
430 |
doubleQuote |
|
431 |
"return the double-quote character" |
|
432 |
||
10936
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
433 |
^ Character codePoint:34 |
699 | 434 |
! |
435 |
||
436 |
esc |
|
437 |
"return the escape character" |
|
438 |
||
10936
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
439 |
^ Character codePoint:27 |
699 | 440 |
! |
441 |
||
10428 | 442 |
etx |
443 |
"return the end-of-text character" |
|
444 |
||
10936
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
445 |
^ Character codePoint:3 |
10428 | 446 |
! |
447 |
||
7688 | 448 |
euro |
7689 | 449 |
"The Euro currency sign (notice: not all fonts support it). |
10936
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
450 |
The Unicode encoding is U+20AC" |
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
451 |
|
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
452 |
^ Character codePoint:16r20AC |
7689 | 453 |
|
454 |
" |
|
10936
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
455 |
Transcript font:(Font family:'courier' size:12 encoding:'iso10646-1'). |
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
456 |
Transcript showCR:Character euro |
7976 | 457 |
" |
458 |
" |
|
7689 | 459 |
0 to:255 do:[:i | |
14684 | 460 |
Transcript |
461 |
show:'| '; show:((i printStringRadix:16) leftPaddedTo:2); |
|
462 |
show:' | '; show:(i printStringPaddedTo:3); |
|
463 |
show:' | '; show:(Character value:i); |
|
464 |
cr. |
|
7689 | 465 |
] |
466 |
" |
|
7688 | 467 |
! |
468 |
||
699 | 469 |
excla |
470 |
"return the exclamation-mark character" |
|
471 |
^ $!! |
|
1 | 472 |
! |
473 |
||
699 | 474 |
ff |
475 |
"return the form-feed character" |
|
476 |
||
10936
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
477 |
^ Character codePoint:12 |
699 | 478 |
! |
479 |
||
480 |
lf |
|
481 |
"return the newline/linefeed character" |
|
482 |
||
10936
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
483 |
^ Character codePoint:10 |
699 | 484 |
! |
1 | 485 |
|
4340
523ef8410fad
added #linefeed - squeak compatibility
Claus Gittinger <cg@exept.de>
parents:
4337
diff
changeset
|
486 |
linefeed |
523ef8410fad
added #linefeed - squeak compatibility
Claus Gittinger <cg@exept.de>
parents:
4337
diff
changeset
|
487 |
"squeak compatibility: return the newline/linefeed character" |
523ef8410fad
added #linefeed - squeak compatibility
Claus Gittinger <cg@exept.de>
parents:
4337
diff
changeset
|
488 |
|
10936
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
489 |
^ Character codePoint:10 |
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
490 |
! |
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
491 |
|
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
492 |
maxImmediateCodePoint |
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
493 |
"return the maximum codePoint until which the characters are shared" |
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
494 |
%{ /* NOCONTEXT */ |
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
495 |
RETURN(__mkSmallInteger(MAX_IMMEDIATE_CHARACTER)); |
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
496 |
%}. |
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
497 |
|
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
498 |
" |
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
499 |
self maxImmediateCodePoint |
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
500 |
" |
4340
523ef8410fad
added #linefeed - squeak compatibility
Claus Gittinger <cg@exept.de>
parents:
4337
diff
changeset
|
501 |
! |
523ef8410fad
added #linefeed - squeak compatibility
Claus Gittinger <cg@exept.de>
parents:
4337
diff
changeset
|
502 |
|
9153 | 503 |
maxValue |
10936
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
504 |
"return the maximum codePoint a character may have" |
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
505 |
|
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
506 |
^ 16r3FFFFFFF |
699 | 507 |
! |
508 |
||
509 |
newPage |
|
23160 | 510 |
"return the form-feed (newPage) character" |
699 | 511 |
|
10936
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
512 |
^ Character codePoint:12 |
23160 | 513 |
|
514 |
"Modified (comment): / 30-06-2018 / 20:37:59 / Claus Gittinger" |
|
699 | 515 |
! |
516 |
||
517 |
nl |
|
518 |
"return the newline character" |
|
68 | 519 |
|
10936
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
520 |
^ Character codePoint:10 |
699 | 521 |
! |
522 |
||
6324 | 523 |
null |
10936
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
524 |
^ Character codePoint:0 |
6324 | 525 |
! |
526 |
||
23160 | 527 |
pageUp |
528 |
"return the pageUp control character" |
|
529 |
||
530 |
^ Character codePoint:11 |
|
531 |
||
532 |
"Created: / 30-06-2018 / 20:36:42 / Claus Gittinger" |
|
533 |
! |
|
534 |
||
699 | 535 |
quote |
536 |
"return the single-quote character" |
|
537 |
||
10936
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
538 |
^ Character codePoint:39 |
699 | 539 |
! |
540 |
||
9153 | 541 |
return |
699 | 542 |
"return the return character. |
543 |
In ST/X, this is different from cr - for Unix reasons." |
|
544 |
||
10936
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
545 |
^ Character codePoint:13 |
699 | 546 |
! |
547 |
||
548 |
space |
|
549 |
"return the blank character" |
|
550 |
||
10936
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
551 |
^ Character codePoint:32 |
699 | 552 |
! |
553 |
||
554 |
tab |
|
555 |
"return the tabulator character" |
|
556 |
||
10936
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
557 |
^ Character codePoint:9 |
1 | 558 |
! ! |
559 |
||
2124 | 560 |
!Character class methodsFor:'primitive input'! |
1 | 561 |
|
562 |
fromUser |
|
357 | 563 |
"return a character from the keyboard (C's standard input stream) |
1 | 564 |
- this should only be used for emergency evaluators and the like." |
565 |
||
566 |
%{ /* NOCONTEXT */ |
|
18691 | 567 |
# include <errno.h> |
568 |
||
1 | 569 |
int c; |
570 |
||
18691 | 571 |
for (;;) { |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
572 |
c = getchar(); |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
573 |
if (c >= 0) break; |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
574 |
if (errno != EINTR) { |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
575 |
RETURN (nil); |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
576 |
} |
1 | 577 |
} |
1133 | 578 |
RETURN ( __MKCHARACTER(c & 0xFF) ); |
5433 | 579 |
%}. |
19378 | 580 |
^ Processor activeProcess stdin next |
1 | 581 |
! ! |
582 |
||
2124 | 583 |
!Character class methodsFor:'queries'! |
3 | 584 |
|
4337
07fad5b7af9b
added #allCharacters & #separators for Squeak compatibility
Claus Gittinger <cg@exept.de>
parents:
4037
diff
changeset
|
585 |
allCharacters |
17249 | 586 |
"added for squeak compatibility: return a collection of all singleton chars. |
587 |
Notice, for memory efficiency reasons, only some of the low-codepoint characters |
|
588 |
are actually kept as singletons. less frequently used character instances are created on the fly, |
|
589 |
as wide string elements are accessed (and hopefully garbage collected sooner or later)" |
|
4337
07fad5b7af9b
added #allCharacters & #separators for Squeak compatibility
Claus Gittinger <cg@exept.de>
parents:
4037
diff
changeset
|
590 |
|
07fad5b7af9b
added #allCharacters & #separators for Squeak compatibility
Claus Gittinger <cg@exept.de>
parents:
4037
diff
changeset
|
591 |
^ CharacterTable |
9153 | 592 |
|
4337
07fad5b7af9b
added #allCharacters & #separators for Squeak compatibility
Claus Gittinger <cg@exept.de>
parents:
4037
diff
changeset
|
593 |
" |
9153 | 594 |
Character allCharacters |
4337
07fad5b7af9b
added #allCharacters & #separators for Squeak compatibility
Claus Gittinger <cg@exept.de>
parents:
4037
diff
changeset
|
595 |
" |
07fad5b7af9b
added #allCharacters & #separators for Squeak compatibility
Claus Gittinger <cg@exept.de>
parents:
4037
diff
changeset
|
596 |
! |
07fad5b7af9b
added #allCharacters & #separators for Squeak compatibility
Claus Gittinger <cg@exept.de>
parents:
4037
diff
changeset
|
597 |
|
4655
b9405ca0bb4e
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4340
diff
changeset
|
598 |
hasSharedInstances |
b9405ca0bb4e
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4340
diff
changeset
|
599 |
"return true if this class has shared instances, that is, instances |
b9405ca0bb4e
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4340
diff
changeset
|
600 |
with the same value are identical. |
9148 | 601 |
Although not always shared (TwoByte CodePoint-Characters), these should be treated |
602 |
so, to be independent of the number of the underlying implementation" |
|
2672
dc3662188b2c
added #hasImmediateInstances for VW compatibility
Claus Gittinger <cg@exept.de>
parents:
2561
diff
changeset
|
603 |
|
4655
b9405ca0bb4e
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4340
diff
changeset
|
604 |
^ true |
2672
dc3662188b2c
added #hasImmediateInstances for VW compatibility
Claus Gittinger <cg@exept.de>
parents:
2561
diff
changeset
|
605 |
! |
dc3662188b2c
added #hasImmediateInstances for VW compatibility
Claus Gittinger <cg@exept.de>
parents:
2561
diff
changeset
|
606 |
|
3 | 607 |
isBuiltInClass |
1271 | 608 |
"return true if this class is known by the run-time-system. |
609 |
Here, true is returned for myself, false for subclasses." |
|
3 | 610 |
|
611 |
^ self == Character |
|
1271 | 612 |
|
613 |
"Modified: 23.4.1996 / 15:56:39 / cg" |
|
4337
07fad5b7af9b
added #allCharacters & #separators for Squeak compatibility
Claus Gittinger <cg@exept.de>
parents:
4037
diff
changeset
|
614 |
! |
07fad5b7af9b
added #allCharacters & #separators for Squeak compatibility
Claus Gittinger <cg@exept.de>
parents:
4037
diff
changeset
|
615 |
|
8206 | 616 |
isLegalUnicodeCodePoint:anInteger |
617 |
"answer true, if anInteger is a valid unicode code point" |
|
618 |
||
9153 | 619 |
"Range 16rD800 - 16rDFFF is reserved for the |
8207
12131fc77a99
#isLegalUnicodeCodePoint: - Fix comment
Stefan Vogel <sv@exept.de>
parents:
8206
diff
changeset
|
620 |
lower and upper substitution page for UCS-16" |
24211 | 621 |
(16rD800 <= anInteger) ifTrue:[ |
622 |
(16rDFFF >= anInteger) ifTrue:[ |
|
623 |
^ false. |
|
624 |
]. |
|
625 |
(anInteger == 16rFFFE) ifTrue:[ |
|
626 |
^ false. |
|
627 |
]. |
|
628 |
(anInteger == 16rFFFF) ifTrue:[ |
|
629 |
^ false. |
|
630 |
]. |
|
631 |
(16r10FFFF < anInteger) ifTrue:[ |
|
632 |
^ false. |
|
633 |
]. |
|
8206 | 634 |
]. |
635 |
^ true |
|
24211 | 636 |
|
637 |
"Modified: / 28-05-2019 / 14:39:01 / Stefan Vogel" |
|
8206 | 638 |
! |
639 |
||
4337
07fad5b7af9b
added #allCharacters & #separators for Squeak compatibility
Claus Gittinger <cg@exept.de>
parents:
4037
diff
changeset
|
640 |
separators |
17249 | 641 |
"return a collection of separator chars. |
642 |
Added for squeak compatibility" |
|
643 |
||
644 |
Separators isNil ifTrue:[ |
|
18215 | 645 |
Separators := Array |
646 |
with:Character space |
|
647 |
with:Character return |
|
648 |
"/ with:Character cr |
|
649 |
with:Character tab |
|
650 |
with:Character lf |
|
651 |
with:Character ff |
|
17249 | 652 |
]. |
653 |
^ Separators |
|
9153 | 654 |
|
4337
07fad5b7af9b
added #allCharacters & #separators for Squeak compatibility
Claus Gittinger <cg@exept.de>
parents:
4037
diff
changeset
|
655 |
" |
07fad5b7af9b
added #allCharacters & #separators for Squeak compatibility
Claus Gittinger <cg@exept.de>
parents:
4037
diff
changeset
|
656 |
Character separators |
07fad5b7af9b
added #allCharacters & #separators for Squeak compatibility
Claus Gittinger <cg@exept.de>
parents:
4037
diff
changeset
|
657 |
" |
3 | 658 |
! ! |
659 |
||
23852 | 660 |
|
7261 | 661 |
!Character methodsFor:'Compatibility-Dolphin'! |
6324 | 662 |
|
7351
1f805a32d551
comments in isAlphaNumeric and isAlphabetic
Claus Gittinger <cg@exept.de>
parents:
7300
diff
changeset
|
663 |
isAlphaNumeric |
18805 | 664 |
"Compatibility method for dolphin and VSE - do not use in new code. |
11956 | 665 |
Return true, if I am a letter or a digit |
7351
1f805a32d551
comments in isAlphaNumeric and isAlphabetic
Claus Gittinger <cg@exept.de>
parents:
7300
diff
changeset
|
666 |
Please use isLetterOrDigit for compatibility reasons (which is ANSI)." |
1f805a32d551
comments in isAlphaNumeric and isAlphabetic
Claus Gittinger <cg@exept.de>
parents:
7300
diff
changeset
|
667 |
|
1f805a32d551
comments in isAlphaNumeric and isAlphabetic
Claus Gittinger <cg@exept.de>
parents:
7300
diff
changeset
|
668 |
^ self isLetterOrDigit |
1f805a32d551
comments in isAlphaNumeric and isAlphabetic
Claus Gittinger <cg@exept.de>
parents:
7300
diff
changeset
|
669 |
! |
1f805a32d551
comments in isAlphaNumeric and isAlphabetic
Claus Gittinger <cg@exept.de>
parents:
7300
diff
changeset
|
670 |
|
1f805a32d551
comments in isAlphaNumeric and isAlphabetic
Claus Gittinger <cg@exept.de>
parents:
7300
diff
changeset
|
671 |
isAlphabetic |
11956 | 672 |
"Compatibility method - do not use in new code. |
673 |
Return true, if I am a letter. |
|
7351
1f805a32d551
comments in isAlphaNumeric and isAlphabetic
Claus Gittinger <cg@exept.de>
parents:
7300
diff
changeset
|
674 |
Please use isLetter for compatibility reasons (which is ANSI)." |
1f805a32d551
comments in isAlphaNumeric and isAlphabetic
Claus Gittinger <cg@exept.de>
parents:
7300
diff
changeset
|
675 |
|
1f805a32d551
comments in isAlphaNumeric and isAlphabetic
Claus Gittinger <cg@exept.de>
parents:
7300
diff
changeset
|
676 |
^ self isLetter |
1f805a32d551
comments in isAlphaNumeric and isAlphabetic
Claus Gittinger <cg@exept.de>
parents:
7300
diff
changeset
|
677 |
! |
1f805a32d551
comments in isAlphaNumeric and isAlphabetic
Claus Gittinger <cg@exept.de>
parents:
7300
diff
changeset
|
678 |
|
6324 | 679 |
isControl |
11956 | 680 |
"Compatibility method - do not use in new code. |
681 |
Return true if I am a control character (i.e. ascii value < 32)" |
|
7353 | 682 |
|
683 |
^ self isControlCharacter |
|
6324 | 684 |
! |
685 |
||
686 |
isHexDigit |
|
7354 | 687 |
"return true if I am a valid hexadecimal digit" |
688 |
||
6324 | 689 |
^ '0123456789abcdefABCDEF' includes:self |
7354 | 690 |
|
691 |
" |
|
692 |
$a isHexDigit |
|
693 |
" |
|
6324 | 694 |
! |
695 |
||
696 |
isPunctuation |
|
11956 | 697 |
"Compatibility method - do not use in new code. |
698 |
The code below is not unicode aware" |
|
7897 | 699 |
|
6327 | 700 |
^ (asciivalue between:16r21 and:16r40) |
701 |
or:[ (asciivalue between:16r5B and:16r60) |
|
702 |
or:[ (asciivalue between:123 and:126) |
|
703 |
or:[ (asciivalue between:161 and:191) |
|
704 |
or:[ (asciivalue == 215 ) |
|
705 |
or:[ (asciivalue == 247 ) ]]]]] |
|
6324 | 706 |
! ! |
707 |
||
21374 | 708 |
|
1 | 709 |
!Character methodsFor:'accessing'! |
710 |
||
8097 | 711 |
codePoint |
712 |
"return the codePoint of myself. |
|
9153 | 713 |
Traditionally, this was named 'asciiValue'; |
8097 | 714 |
however, characters are not limited to 8bit characters." |
715 |
||
716 |
^ asciivalue |
|
717 |
! |
|
718 |
||
1 | 719 |
instVarAt:index put:anObject |
54 | 720 |
"catch instvar access - asciivalue may not be changed" |
1 | 721 |
|
722 |
self error:'Characters may not be modified' |
|
723 |
! ! |
|
724 |
||
699 | 725 |
!Character methodsFor:'arithmetic'! |
1 | 726 |
|
727 |
+ aMagnitude |
|
9153 | 728 |
"Return the Character that is <aMagnitude> higher than the receiver. |
1 | 729 |
Wrap if the resulting value is not a legal Character value. (JS)" |
730 |
||
10936
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
731 |
^ Character codePoint:((asciivalue + aMagnitude asInteger) \\ 16r3FFFFFFF) |
1491
a42ae3fbb756
fixed asLowercase / asUppercase for national characters
Claus Gittinger <cg@exept.de>
parents:
1295
diff
changeset
|
732 |
|
a42ae3fbb756
fixed asLowercase / asUppercase for national characters
Claus Gittinger <cg@exept.de>
parents:
1295
diff
changeset
|
733 |
" |
a42ae3fbb756
fixed asLowercase / asUppercase for national characters
Claus Gittinger <cg@exept.de>
parents:
1295
diff
changeset
|
734 |
$A + 5 |
a42ae3fbb756
fixed asLowercase / asUppercase for national characters
Claus Gittinger <cg@exept.de>
parents:
1295
diff
changeset
|
735 |
" |
a42ae3fbb756
fixed asLowercase / asUppercase for national characters
Claus Gittinger <cg@exept.de>
parents:
1295
diff
changeset
|
736 |
|
a42ae3fbb756
fixed asLowercase / asUppercase for national characters
Claus Gittinger <cg@exept.de>
parents:
1295
diff
changeset
|
737 |
"Modified: 27.6.1996 / 12:34:51 / cg" |
1 | 738 |
! |
739 |
||
740 |
- aMagnitude |
|
9153 | 741 |
"Return the Character that is <aMagnitude> lower than the receiver. |
68 | 742 |
Wrap if the resulting value is not a legal Character value. (JS) |
9153 | 743 |
claus: |
744 |
modified to return the difference as integer, if the argument |
|
745 |
is another character. If the argument is a number, a character is |
|
746 |
returned." |
|
1 | 747 |
|
68 | 748 |
aMagnitude isCharacter ifTrue:[ |
9153 | 749 |
^ asciivalue - aMagnitude asInteger |
68 | 750 |
]. |
10936
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
751 |
^ Character codePoint:((asciivalue - aMagnitude asInteger) \\ 16r3FFFFFFF) |
68 | 752 |
|
753 |
" |
|
9153 | 754 |
$z - $a |
68 | 755 |
$d - 3 |
756 |
" |
|
1491
a42ae3fbb756
fixed asLowercase / asUppercase for national characters
Claus Gittinger <cg@exept.de>
parents:
1295
diff
changeset
|
757 |
|
a42ae3fbb756
fixed asLowercase / asUppercase for national characters
Claus Gittinger <cg@exept.de>
parents:
1295
diff
changeset
|
758 |
"Modified: 27.6.1996 / 12:35:34 / cg" |
1 | 759 |
! |
760 |
||
761 |
// aMagnitude |
|
9153 | 762 |
"Return the Character who's value is the receiver divided by <aMagnitude>. |
1 | 763 |
Wrap if the resulting value is not a legal Character value. (JS)" |
764 |
||
10936
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
765 |
^ Character codePoint:(asciivalue // aMagnitude asInteger \\ 16r3FFFFFFF) |
1 | 766 |
! |
767 |
||
768 |
\\ aMagnitude |
|
9153 | 769 |
"Return the Character who's value is the receiver modulo <aMagnitude>. |
1 | 770 |
Wrap if the resulting value is not a legal Character value. (JS)" |
771 |
||
10936
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
772 |
^ Character codePoint:(asciivalue \\ aMagnitude asInteger \\ 16r3FFFFFFF) |
1 | 773 |
! ! |
774 |
||
699 | 775 |
|
776 |
!Character methodsFor:'comparing'! |
|
777 |
||
8143 | 778 |
< aMagnitude |
7799 | 779 |
"return true, if the arguments asciiValue is greater than the receiver's" |
699 | 780 |
|
8143 | 781 |
^ (asciivalue < aMagnitude asInteger) |
699 | 782 |
! |
783 |
||
8143 | 784 |
<= aMagnitude |
7799 | 785 |
"return true, if the arguments asciiValue is greater or equal to the receiver's" |
699 | 786 |
|
8143 | 787 |
^ (asciivalue <= aMagnitude asInteger) |
699 | 788 |
! |
789 |
||
790 |
= aCharacter |
|
791 |
"return true, if the argument, aCharacter is the same character |
|
8143 | 792 |
Redefined to take care of character sizes > 8bit." |
18298 | 793 |
%{ |
794 |
#ifdef __SCHTEAM__ |
|
795 |
if (self == aCharacter) { |
|
796 |
return context._RETURN_true(); |
|
797 |
} |
|
798 |
if (aCharacter.characterP() == STObject.True) { |
|
799 |
if (self.charValue() == aCharacter.charValue()) { |
|
800 |
return context._RETURN_true(); |
|
801 |
} else { |
|
802 |
return context._RETURN_false(); |
|
803 |
} |
|
804 |
} |
|
805 |
#endif /* not SCHTEAM */ |
|
806 |
%}. |
|
699 | 807 |
self == aCharacter ifTrue:[^ true]. |
808 |
aCharacter isCharacter ifFalse:[^ false]. |
|
8143 | 809 |
^ asciivalue = aCharacter codePoint |
810 |
||
811 |
" |
|
18215 | 812 |
$A = (Character value:65) |
813 |
$A = (Character codePoint:65) |
|
814 |
$A = ($B-1) |
|
815 |
$A = 65 |
|
8143 | 816 |
" |
699 | 817 |
! |
818 |
||
8143 | 819 |
> aMagnitude |
7799 | 820 |
"return true, if the arguments asciiValue is less than the receiver's" |
699 | 821 |
|
8143 | 822 |
^ (asciivalue > aMagnitude asInteger) |
699 | 823 |
! |
824 |
||
8143 | 825 |
>= aMagnitude |
7799 | 826 |
"return true, if the arguments asciiValue is less or equal to the receiver's" |
699 | 827 |
|
8143 | 828 |
^ (asciivalue >= aMagnitude asInteger) |
699 | 829 |
! |
830 |
||
5540 | 831 |
hash |
832 |
"return an integer useful for hashing" |
|
833 |
||
834 |
^ asciivalue |
|
835 |
! |
|
836 |
||
699 | 837 |
identityHash |
838 |
"return an integer useful for hashing on identity" |
|
839 |
||
9153 | 840 |
%{ |
8100 | 841 |
INT __codePoint; |
842 |
||
843 |
__codePoint = __smallIntegerVal(__INST(asciivalue)); |
|
844 |
||
845 |
if (__codePoint <= MAX_IMMEDIATE_CHARACTER) { |
|
9153 | 846 |
RETURN ( __mkSmallInteger(__codePoint + 4096) ); |
8100 | 847 |
} |
848 |
%}. |
|
849 |
||
699 | 850 |
^ super identityHash |
8100 | 851 |
|
852 |
" |
|
853 |
$a identityHash. |
|
854 |
(Character value:1234) identityHash |
|
855 |
" |
|
699 | 856 |
! |
857 |
||
858 |
sameAs:aCharacter |
|
859 |
"return true, if the argument, aCharacter is the same character, |
|
860 |
ignoring case differences." |
|
861 |
||
21673 | 862 |
"Note: stc inlines codePoint, so this is faster than compare with #= |
863 |
and works also for chars > 8bit" |
|
864 |
self codePoint == aCharacter codePoint ifTrue:[^ true]. |
|
865 |
^ self asLowercase codePoint == aCharacter asLowercase codePoint. |
|
14663 | 866 |
|
867 |
" |
|
24144 | 868 |
$x sameAs:$X |
14663 | 869 |
(Character value:345) sameAs:(Character value:345) |
24144 | 870 |
$Ж sameAs:$ж -- u0416 - u0436 |
871 |
$ж sameAs:$Ж -- u0436 - u0416 |
|
14663 | 872 |
" |
21673 | 873 |
|
874 |
"Modified (comment): / 28-03-2017 / 16:19:48 / stefan" |
|
24144 | 875 |
"Modified (comment): / 25-05-2019 / 08:29:59 / Claus Gittinger" |
699 | 876 |
! |
877 |
||
878 |
~= aCharacter |
|
879 |
"return true, if the argument, aCharacter is not the same character |
|
8143 | 880 |
Redefined to take care of character sizes > 8bit." |
699 | 881 |
|
882 |
self == aCharacter ifTrue:[^ false]. |
|
883 |
aCharacter isCharacter ifFalse:[^ true]. |
|
8097 | 884 |
^ (asciivalue ~~ aCharacter codePoint) |
699 | 885 |
! ! |
886 |
||
887 |
!Character methodsFor:'converting'! |
|
888 |
||
889 |
asCharacter |
|
890 |
"usually sent to integers, but redefined here to allow integers |
|
891 |
and characters to be used commonly without a need for a test." |
|
892 |
||
893 |
^ self |
|
894 |
||
895 |
" |
|
9153 | 896 |
32 asCharacter |
699 | 897 |
" |
898 |
! |
|
899 |
||
900 |
asInteger |
|
8143 | 901 |
"the same as #codePoint. |
902 |
Use #asInteger, if you need protocol compatibility with Numbers etc.. |
|
903 |
Use #codePoint in any other case for better stc optimization" |
|
699 | 904 |
|
905 |
^ asciivalue |
|
906 |
! |
|
907 |
||
908 |
asLowercase |
|
8010 | 909 |
"return a character with same letter as the receiver, but in lowercase. |
8022
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
910 |
Returns the receiver if it is already lowercase or if there is no lowercase equivalent. |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
911 |
CAVEAT: |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
912 |
for now, this method is only correct for unicode characters up to u+1d6ff (Unicode3.1). |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
913 |
(which is more than mozilla does, btw. ;-)" |
7989
7907420b2fab
asUppercase / asLowercase for U0100..U04FF
Claus Gittinger <cg@exept.de>
parents:
7988
diff
changeset
|
914 |
|
8010 | 915 |
%{ |
18240
28af09029a8b
ifdef for SCHTEAM engine changed (not relevant for ST/X)
Claus Gittinger <cg@exept.de>
parents:
18215
diff
changeset
|
916 |
#ifdef __SCHTEAM__ |
18215 | 917 |
{ |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
918 |
char ch = self.charValue("[asLowercase]"); |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
919 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
920 |
ch = java.lang.Character.toLowerCase(ch); |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
921 |
return context._RETURN(STCharacter._new(ch)); |
18215 | 922 |
} |
923 |
/* NOTREACHED */ |
|
924 |
#else |
|
14684 | 925 |
static int __mapping[] = { |
9153 | 926 |
/* From To Every Diff */ |
8010 | 927 |
0x0041, ((0x19 << 8) | 0x01), 0x0020 , |
928 |
0x00c0, ((0x16 << 8) | 0x01), 0x0020 , |
|
929 |
0x00d8, ((0x06 << 8) | 0x01), 0x0020 , |
|
930 |
0x0100, ((0x2e << 8) | 0x02), 0x0001 , |
|
8022
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
931 |
0x0130, ((0x00 << 8) | 0x00), -199 , |
8010 | 932 |
0x0132, ((0x04 << 8) | 0x02), 0x0001 , |
933 |
0x0139, ((0x0e << 8) | 0x02), 0x0001 , |
|
934 |
0x014a, ((0x2c << 8) | 0x02), 0x0001 , |
|
8022
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
935 |
0x0178, ((0x00 << 8) | 0x00), -121 , |
8010 | 936 |
0x0179, ((0x04 << 8) | 0x02), 0x0001 , |
937 |
0x0181, ((0x00 << 8) | 0x00), 0x00d2 , |
|
938 |
0x0182, ((0x02 << 8) | 0x02), 0x0001 , |
|
939 |
0x0186, ((0x00 << 8) | 0x00), 0x00ce , |
|
940 |
0x0187, ((0x00 << 8) | 0x00), 0x0001 , |
|
941 |
0x0189, ((0x01 << 8) | 0x01), 0x00cd , |
|
942 |
0x018b, ((0x00 << 8) | 0x00), 0x0001 , |
|
943 |
0x018e, ((0x00 << 8) | 0x00), 0x004f , |
|
944 |
0x018f, ((0x00 << 8) | 0x00), 0x00ca , |
|
945 |
0x0190, ((0x00 << 8) | 0x00), 0x00cb , |
|
946 |
0x0191, ((0x00 << 8) | 0x00), 0x0001 , |
|
947 |
0x0193, ((0x00 << 8) | 0x00), 0x00cd , |
|
948 |
0x0194, ((0x00 << 8) | 0x00), 0x00cf , |
|
949 |
0x0196, ((0x00 << 8) | 0x00), 0x00d3 , |
|
950 |
0x0197, ((0x00 << 8) | 0x00), 0x00d1 , |
|
951 |
0x0198, ((0x00 << 8) | 0x00), 0x0001 , |
|
952 |
0x019c, ((0x00 << 8) | 0x00), 0x00d3 , |
|
953 |
0x019d, ((0x00 << 8) | 0x00), 0x00d5 , |
|
954 |
0x019f, ((0x00 << 8) | 0x00), 0x00d6 , |
|
955 |
0x01a0, ((0x04 << 8) | 0x02), 0x0001 , |
|
956 |
0x01a6, ((0x00 << 8) | 0x00), 0x00da , |
|
957 |
0x01a7, ((0x00 << 8) | 0x00), 0x0001 , |
|
958 |
0x01a9, ((0x00 << 8) | 0x00), 0x00da , |
|
959 |
0x01ac, ((0x00 << 8) | 0x00), 0x0001 , |
|
960 |
0x01ae, ((0x00 << 8) | 0x00), 0x00da , |
|
961 |
0x01af, ((0x00 << 8) | 0x00), 0x0001 , |
|
962 |
0x01b1, ((0x01 << 8) | 0x01), 0x00d9 , |
|
963 |
0x01b3, ((0x02 << 8) | 0x02), 0x0001 , |
|
964 |
0x01b7, ((0x00 << 8) | 0x00), 0x00db , |
|
965 |
0x01b8, ((0x04 << 8) | 0x04), 0x0001 , |
|
966 |
0x01c4, ((0x00 << 8) | 0x00), 0x0002 , |
|
967 |
0x01c5, ((0x00 << 8) | 0x00), 0x0001 , |
|
968 |
0x01c7, ((0x00 << 8) | 0x00), 0x0002 , |
|
969 |
0x01c8, ((0x00 << 8) | 0x00), 0x0001 , |
|
970 |
0x01ca, ((0x00 << 8) | 0x00), 0x0002 , |
|
971 |
0x01cb, ((0x10 << 8) | 0x02), 0x0001 , |
|
972 |
0x01de, ((0x10 << 8) | 0x02), 0x0001 , |
|
973 |
0x01f1, ((0x00 << 8) | 0x00), 0x0002 , |
|
974 |
0x01f2, ((0x02 << 8) | 0x02), 0x0001 , |
|
8022
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
975 |
0x01f6, ((0x00 << 8) | 0x00), -97 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
976 |
0x01f7, ((0x00 << 8) | 0x00), -56 , |
8010 | 977 |
0x01f8, ((0x26 << 8) | 0x02), 0x0001 , |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
978 |
#ifndef UNICODE_3_2 |
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
979 |
0x0220, ((0x00 << 8) | 0x00), -130 , /* Unicode4.0 - not in X fonts - sigh */ |
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
980 |
#endif |
8010 | 981 |
0x0222, ((0x10 << 8) | 0x02), 0x0001 , |
982 |
0x0386, ((0x00 << 8) | 0x00), 0x0026 , |
|
983 |
0x0388, ((0x02 << 8) | 0x01), 0x0025 , |
|
984 |
0x038c, ((0x00 << 8) | 0x00), 0x0040 , |
|
985 |
0x038e, ((0x01 << 8) | 0x01), 0x003f , |
|
986 |
0x0391, ((0x10 << 8) | 0x01), 0x0020 , |
|
987 |
0x03a3, ((0x08 << 8) | 0x01), 0x0020 , |
|
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
988 |
#ifndef UNICODE_3_2 |
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
989 |
0x03d8, ((0x00 << 8) | 0x00), 1 , /* Unicode4.0 - not in X fonts - sigh */ |
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
990 |
#endif |
8010 | 991 |
0x03da, ((0x14 << 8) | 0x02), 0x0001 , |
8022
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
992 |
0x03f4, ((0x00 << 8) | 0x00), -60 , |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
993 |
#ifndef UNICODE_3_2 |
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
994 |
0x03f7, ((0x03 << 8) | 0x03), 1 , /* Unicode4.0 - not in X fonts - sigh */ |
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
995 |
0x03f9, ((0x00 << 8) | 0x00), -7 , /* Unicode4.0 - not in X fonts - sigh */ |
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
996 |
#endif |
8010 | 997 |
0x0400, ((0x0f << 8) | 0x01), 0x0050 , |
998 |
0x0410, ((0x1f << 8) | 0x01), 0x0020 , |
|
999 |
0x0460, ((0x20 << 8) | 0x02), 0x0001 , |
|
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
1000 |
#ifndef UNICODE_3_2 |
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
1001 |
0x048a, ((0x00 << 8) | 0x00), 1 , /* Unicode4.0 - not in X fonts - sigh */ |
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
1002 |
#endif |
8010 | 1003 |
0x048c, ((0x32 << 8) | 0x02), 0x0001 , |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
1004 |
#ifdef UNICODE_3_2 |
8010 | 1005 |
0x04c1, ((0x02 << 8) | 0x02), 0x0001 , |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
1006 |
#else |
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
1007 |
0x04c1, ((0x04 << 8) | 0x02), 0x0001 , /* Unicode4.0 - not in X fonts - sigh */ |
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
1008 |
#endif |
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
1009 |
#ifdef UNICODE_3_2 |
8010 | 1010 |
0x04c7, ((0x04 << 8) | 0x04), 0x0001 , |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
1011 |
#else |
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
1012 |
0x04c7, ((0x04 << 8) | 0x02), 0x0001 , |
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
1013 |
0x04cd, ((0x00 << 8) | 0x00), 0x0001 , |
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
1014 |
#endif |
8010 | 1015 |
0x04d0, ((0x24 << 8) | 0x02), 0x0001 , |
1016 |
0x04f8, ((0x00 << 8) | 0x00), 0x0001 , |
|
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
1017 |
#ifndef UNICODE_3_2 |
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
1018 |
0x0500, ((0x0E << 8) | 0x02), 1 , |
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
1019 |
#endif |
8010 | 1020 |
0x0531, ((0x25 << 8) | 0x01), 0x0030 , |
1021 |
0x1e00, ((0x94 << 8) | 0x02), 0x0001 , |
|
1022 |
0x1ea0, ((0x58 << 8) | 0x02), 0x0001 , |
|
8022
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1023 |
0x1f08, ((0x07 << 8) | 0x01), -8 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1024 |
0x1f18, ((0x05 << 8) | 0x01), -8 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1025 |
0x1f28, ((0x07 << 8) | 0x01), -8 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1026 |
0x1f38, ((0x07 << 8) | 0x01), -8 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1027 |
0x1f48, ((0x05 << 8) | 0x01), -8 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1028 |
0x1f59, ((0x06 << 8) | 0x02), -8 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1029 |
0x1f68, ((0x07 << 8) | 0x01), -8 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1030 |
0x1f88, ((0x07 << 8) | 0x01), -8 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1031 |
0x1f98, ((0x07 << 8) | 0x01), -8 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1032 |
0x1fa8, ((0x07 << 8) | 0x01), -8 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1033 |
0x1fb8, ((0x01 << 8) | 0x01), -8 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1034 |
0x1fba, ((0x01 << 8) | 0x01), -74 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1035 |
0x1fbc, ((0x00 << 8) | 0x00), -9 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1036 |
0x1fc8, ((0x03 << 8) | 0x01), -86 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1037 |
0x1fcc, ((0x00 << 8) | 0x00), -9 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1038 |
0x1fd8, ((0x01 << 8) | 0x01), -8 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1039 |
0x1fda, ((0x01 << 8) | 0x01), -100 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1040 |
0x1fe8, ((0x01 << 8) | 0x01), -8 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1041 |
0x1fea, ((0x01 << 8) | 0x01), -112 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1042 |
0x1fec, ((0x00 << 8) | 0x00), -7 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1043 |
0x1ff8, ((0x01 << 8) | 0x01), -128 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1044 |
0x1ffa, ((0x01 << 8) | 0x01), -126 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1045 |
0x1ffc, ((0x00 << 8) | 0x00), -9 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1046 |
0x2126, ((0x00 << 8) | 0x00), -7517 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1047 |
0x212a, ((0x00 << 8) | 0x00), -8383 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1048 |
0x212b, ((0x00 << 8) | 0x00), -8262 , |
8010 | 1049 |
0x2160, ((0x0f << 8) | 0x01), 0x0010 , |
1050 |
0x24b6, ((0x19 << 8) | 0x01), 0x001a , |
|
9153 | 1051 |
0xff21, ((0x19 << 8) | 0x01), 0x0020 , |
1052 |
0x10400, ((0x27 << 8) | 0x01), 0x0028 |
|
8010 | 1053 |
}; |
1491
a42ae3fbb756
fixed asLowercase / asUppercase for national characters
Claus Gittinger <cg@exept.de>
parents:
1295
diff
changeset
|
1054 |
|
14684 | 1055 |
REGISTER unsigned INT __codePoint; |
8308 | 1056 |
REGISTER int * __p; |
8010 | 1057 |
|
1058 |
__codePoint = __intVal(__INST(asciivalue)); |
|
18691 | 1059 |
|
1060 |
// comon ascii stuff first |
|
1061 |
if (__codePoint < 0x80) { |
|
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1062 |
if ((__codePoint >= 'A') && (__codePoint <= 'Z')) { |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1063 |
unsigned int newCodePoint = __codePoint - 'A' + 'a'; |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1064 |
RETURN (__MKCHARACTER(newCodePoint)) ; |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1065 |
} |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1066 |
RETURN (self); |
18691 | 1067 |
} |
1068 |
||
8106
ee222c1314e6
cannot make pointer arith with a void *
Claus Gittinger <cg@exept.de>
parents:
8100
diff
changeset
|
1069 |
for (__p = __mapping; (char *)__p < ((char *)__mapping) + sizeof(__mapping); __p += 3) { |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1070 |
unsigned rangeStart, rangeSize, rangeEnd, mod; |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1071 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1072 |
rangeStart = (unsigned)__p[0]; |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1073 |
if (__codePoint < rangeStart) break; |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1074 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1075 |
rangeSize = ((unsigned)__p[1]) >> 8; |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1076 |
rangeEnd = rangeStart + rangeSize; |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1077 |
if (__codePoint <= rangeEnd) { |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1078 |
mod = __p[1] & 0xFF; |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1079 |
if ((mod == 0) || (((__codePoint - rangeStart) % mod) == 0)) { |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1080 |
OBJ newChar; |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1081 |
unsigned newCodePoint; |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1082 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1083 |
newCodePoint = __codePoint + __p[2]; |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1084 |
if (newCodePoint <= MAX_IMMEDIATE_CHARACTER) { |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1085 |
RETURN (__MKCHARACTER(newCodePoint)) ; |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1086 |
} |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1087 |
newChar = __MKUCHARACTER(newCodePoint) ; |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1088 |
if (newChar == nil) goto allocationError; |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1089 |
RETURN (newChar) ; |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1090 |
} |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1091 |
} |
8010 | 1092 |
} |
1093 |
RETURN (self); |
|
8022
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1094 |
allocationError: ; |
18240
28af09029a8b
ifdef for SCHTEAM engine changed (not relevant for ST/X)
Claus Gittinger <cg@exept.de>
parents:
18215
diff
changeset
|
1095 |
#endif /* ! __SCHTEAM__ */ |
8010 | 1096 |
%}. |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1097 |
^ AllocationFailure raise. |
1491
a42ae3fbb756
fixed asLowercase / asUppercase for national characters
Claus Gittinger <cg@exept.de>
parents:
1295
diff
changeset
|
1098 |
|
a42ae3fbb756
fixed asLowercase / asUppercase for national characters
Claus Gittinger <cg@exept.de>
parents:
1295
diff
changeset
|
1099 |
" |
9153 | 1100 |
$A asLowercase |
1101 |
$a asLowercase |
|
1102 |
(Character value:16r01F5) asUppercase asLowercase |
|
1103 |
(Character value:16r0205) asUppercase asLowercase |
|
1104 |
(Character value:16r03B1) asUppercase asLowercase |
|
1105 |
(Character value:16r1E00) asLowercase |
|
1106 |
" |
|
699 | 1107 |
! |
1108 |
||
1109 |
asString |
|
1110 |
"return a string of len 1 with myself as contents" |
|
1111 |
||
1112 |
%{ /* NOCONTEXT */ |
|
1113 |
char buffer[2]; |
|
1114 |
OBJ s; |
|
14684 | 1115 |
unsigned INT val; |
699 | 1116 |
|
15262
5047292c9107
all stx macros begin with double underline (eg. __qClass instead of _qClass)
Claus Gittinger <cg@exept.de>
parents:
14684
diff
changeset
|
1117 |
val = __intVal(__characterVal(self)); |
995
b018368b3a94
asString to 16-bit char should return a twoByteString
Claus Gittinger <cg@exept.de>
parents:
819
diff
changeset
|
1118 |
if (val <= 0xFF) { |
9153 | 1119 |
buffer[0] = (char) val; |
1120 |
buffer[1] = '\0'; |
|
1121 |
s = __MKSTRING_L(buffer, 1); |
|
1122 |
if (s != nil) { |
|
1123 |
RETURN (s); |
|
1124 |
} |
|
699 | 1125 |
} |
8004
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1126 |
if (val <= 0xFFFF) { |
9153 | 1127 |
s = __MKEMPTYU16STRING(1); |
1128 |
if (s != nil) { |
|
1129 |
__Unicode16StringInstPtr(s)->s_element[0] = val; |
|
1130 |
RETURN (s); |
|
1131 |
} |
|
8004
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1132 |
} |
699 | 1133 |
%}. |
7951 | 1134 |
asciivalue > 16rFF ifTrue:[ |
9153 | 1135 |
asciivalue > 16rFFFF ifTrue:[ |
1136 |
^ (Unicode32String new:1) at:1 put:self; yourself |
|
1137 |
]. |
|
1138 |
^ (Unicode16String new:1) at:1 put:self; yourself |
|
995
b018368b3a94
asString to 16-bit char should return a twoByteString
Claus Gittinger <cg@exept.de>
parents:
819
diff
changeset
|
1139 |
]. |
b018368b3a94
asString to 16-bit char should return a twoByteString
Claus Gittinger <cg@exept.de>
parents:
819
diff
changeset
|
1140 |
|
5407 | 1141 |
^ (String new:1) at:1 put:self; yourself. |
8004
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1142 |
|
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1143 |
" |
9153 | 1144 |
(Character value:16rB5) asString |
1145 |
(Character value:16r1B5) asString |
|
8004
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1146 |
" |
699 | 1147 |
! |
1148 |
||
1149 |
asSymbol |
|
17184 | 1150 |
"Return a unique symbol with the name taken from the receiver's characters. |
9229 | 1151 |
Here, a single character symbol is returned." |
699 | 1152 |
|
1153 |
^ Symbol internCharacter:self |
|
1154 |
! |
|
1155 |
||
8022
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1156 |
asTitlecase |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1157 |
"return a character with same letter as the receiver, but in titlecase. |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1158 |
Returns the receiver if it is already titlecase or if there is no titlecase equivalent." |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1159 |
|
8026 | 1160 |
" |
9153 | 1161 |
For example, in Unicode, character U+01F3 is LATIN SMALL LETTER DZ. |
1162 |
(Let us write this compound character using ASCII as 'dz'.) |
|
1163 |
This character uppercases to character U+01F1, LATIN CAPITAL LETTER DZ. |
|
1164 |
(Which is basically 'DZ'.) |
|
1165 |
But it titlecases to to character U+01F2, LATIN CAPITAL LETTER D WITH SMALL LETTER Z. |
|
8026 | 1166 |
(Which we can write 'Dz'.) |
1167 |
||
1168 |
character uppercase titlecase |
|
1169 |
--------- --------- --------- |
|
1170 |
dz DZ Dz |
|
1171 |
" |
|
8022
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1172 |
|ch| |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1173 |
|
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1174 |
%{ |
14684 | 1175 |
static unsigned short __mapping[] = { |
9153 | 1176 |
0x01C4, 0x01C5, |
1177 |
0x01C6, 0x01C5, |
|
1178 |
0x01C7, 0x01C8, |
|
1179 |
0x01C9, 0x01C8, |
|
1180 |
0x01CA, 0x01CB, |
|
1181 |
0x01CC, 0x01CB, |
|
14684 | 1182 |
0x01F1, 0x01F2, |
1183 |
0x01F3, 0x01F2, |
|
8022
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1184 |
}; |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1185 |
|
14684 | 1186 |
REGISTER unsigned INT __codePoint; |
8885 | 1187 |
REGISTER unsigned short *__p; |
8022
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1188 |
|
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1189 |
__codePoint = __intVal(__INST(asciivalue)); |
18691 | 1190 |
if ((__codePoint > 0x01C0) && (__codePoint < 0x01FF)) { |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1191 |
for (__p = __mapping; (char *)__p < ((char *)__mapping) + sizeof(__mapping); __p += 2) { |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1192 |
if ((__codePoint == __p[0]) || (__codePoint == __p[1])) { |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1193 |
short newCodePoint; |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1194 |
OBJ newChar; |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1195 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1196 |
newCodePoint = __p[1]; |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1197 |
if (newCodePoint == __codePoint) { |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1198 |
RETURN (self); |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1199 |
} |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1200 |
if (newCodePoint <= MAX_IMMEDIATE_CHARACTER) { |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1201 |
RETURN (__MKCHARACTER(newCodePoint)) ; |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1202 |
} |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1203 |
newChar = __MKUCHARACTER(newCodePoint) ; |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1204 |
if (newChar == nil) goto getOutOfHere; |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1205 |
RETURN (newChar) ; |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1206 |
} |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1207 |
} |
8022
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1208 |
} |
18691 | 1209 |
if (__codePoint < 0x80) { |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1210 |
// do it here for common ascii characters |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1211 |
if ((__codePoint >= 'a') && (__codePoint <= 'z')) { |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1212 |
unsigned char newCodePoint = __codePoint - 'a' + 'A'; |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1213 |
RETURN (__MKCHARACTER(newCodePoint)) ; |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1214 |
} |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1215 |
RETURN (self) ; |
18691 | 1216 |
} |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1217 |
|
8022
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1218 |
ch = self; |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1219 |
getOutOfHere: ; |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1220 |
%}. |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1221 |
ch notNil ifTrue:[ |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1222 |
^ ch asUppercase. |
8022
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1223 |
]. |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1224 |
|
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1225 |
^ AllocationFailure raise. |
8022
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1226 |
|
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1227 |
" |
9153 | 1228 |
$A asTitlecase |
1229 |
$a asTitlecase |
|
1230 |
(Character value:16r01F1) asTitlecase |
|
18691 | 1231 |
(Character value:16r01F2) asTitlecase |
9153 | 1232 |
" |
8022
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1233 |
! |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1234 |
|
6029 | 1235 |
asUnicodeString |
8004
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1236 |
"return a unicode string of len 1 with myself as contents. |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1237 |
This will vanish, as we now (rel5.2.x) use Unicode as default." |
6029 | 1238 |
|
7951 | 1239 |
asciivalue > 16rFFFF ifTrue:[ |
9153 | 1240 |
^ (Unicode32String new:1) at:1 put:self; yourself. |
7951 | 1241 |
]. |
1242 |
^ (Unicode16String new:1) at:1 put:self; yourself. |
|
6029 | 1243 |
! |
1244 |
||
699 | 1245 |
asUppercase |
8010 | 1246 |
"return a character with same letter as the receiver, but in uppercase. |
8022
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1247 |
Returns the receiver if it is already uppercase or if there is no uppercase equivalent. |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1248 |
CAVEAT: |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1249 |
for now, this method is only correct for unicode characters up to u+1d6ff (Unicode3.1). |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1250 |
(which is more than mozilla does, btw. ;-)" |
7990
2f78c1d609c7
asUppercase / asLowercase for UFF00..UFFFF
Claus Gittinger <cg@exept.de>
parents:
7989
diff
changeset
|
1251 |
|
8004
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1252 |
%{ |
18240
28af09029a8b
ifdef for SCHTEAM engine changed (not relevant for ST/X)
Claus Gittinger <cg@exept.de>
parents:
18215
diff
changeset
|
1253 |
#ifdef __SCHTEAM__ |
18215 | 1254 |
{ |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1255 |
char ch = self.charValue("[asUppercase]"); |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1256 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1257 |
ch = java.lang.Character.toUpperCase(ch); |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1258 |
return context._RETURN(STCharacter._new(ch)); |
18215 | 1259 |
} |
1260 |
/* NOTREACHED */ |
|
1261 |
#else |
|
14684 | 1262 |
static int __mapping[] = { |
9153 | 1263 |
/* From To Every Diff */ |
8022
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1264 |
0x0061, ((0x19 << 8) | 0x01), -32 , |
8004
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1265 |
0x00b5, ((0x00 << 8) | 0x3b), 0x02e7 , |
8022
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1266 |
0x00e0, ((0x16 << 8) | 0x01), -32 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1267 |
0x00f8, ((0x06 << 8) | 0x01), -32 , |
8004
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1268 |
0x00ff, ((0x00 << 8) | 0x01), 0x0079 , |
8022
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1269 |
0x0101, ((0x2e << 8) | 0x02), -1 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1270 |
0x0131, ((0x00 << 8) | 0x02), -232 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1271 |
0x0133, ((0x04 << 8) | 0x02), -1 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1272 |
0x013a, ((0x0e << 8) | 0x02), -1 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1273 |
0x014b, ((0x2c << 8) | 0x02), -1 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1274 |
0x017a, ((0x04 << 8) | 0x02), -1 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1275 |
0x017f, ((0x00 << 8) | 0x01), -300 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1276 |
0x0183, ((0x02 << 8) | 0x02), -1 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1277 |
0x0188, ((0x04 << 8) | 0x04), -1 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1278 |
0x0192, ((0x00 << 8) | 0x06), -1 , |
8004
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1279 |
0x0195, ((0x00 << 8) | 0x03), 0x0061 , |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
1280 |
#ifndef UNICODE_3_2 |
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
1281 |
0x0199, ((0x04 << 8) | 0x08), -1 , |
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
1282 |
0x019e, ((0x00 << 8) | 0x00), 130 , /* Unicode4.0 - not in X fonts - sigh */ |
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
1283 |
#endif |
8022
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1284 |
0x0199, ((0x08 << 8) | 0x08), -1 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1285 |
0x01a3, ((0x02 << 8) | 0x02), -1 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1286 |
0x01a8, ((0x05 << 8) | 0x05), -1 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1287 |
0x01b0, ((0x04 << 8) | 0x04), -1 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1288 |
0x01b6, ((0x03 << 8) | 0x03), -1 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1289 |
0x01bd, ((0x00 << 8) | 0x04), -1 , |
8004
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1290 |
0x01bf, ((0x00 << 8) | 0x02), 0x0038 , |
8022
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1291 |
0x01c5, ((0x00 << 8) | 0x06), -1 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1292 |
0x01c6, ((0x00 << 8) | 0x01), -2 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1293 |
0x01c8, ((0x00 << 8) | 0x02), -1 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1294 |
0x01c9, ((0x00 << 8) | 0x01), -2 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1295 |
0x01cb, ((0x00 << 8) | 0x02), -1 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1296 |
0x01cc, ((0x00 << 8) | 0x01), -2 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1297 |
0x01ce, ((0x0e << 8) | 0x02), -1 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1298 |
0x01dd, ((0x00 << 8) | 0x01), -79 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1299 |
0x01df, ((0x10 << 8) | 0x02), -1 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1300 |
0x01f2, ((0x00 << 8) | 0x03), -1 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1301 |
0x01f3, ((0x00 << 8) | 0x01), -2 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1302 |
0x01f5, ((0x04 << 8) | 0x04), -1 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1303 |
0x01fb, ((0x24 << 8) | 0x02), -1 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1304 |
0x0223, ((0x10 << 8) | 0x02), -1 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1305 |
0x0253, ((0x00 << 8) | 0x20), -210 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1306 |
0x0254, ((0x00 << 8) | 0x01), -206 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1307 |
0x0256, ((0x01 << 8) | 0x01), -205 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1308 |
0x0259, ((0x00 << 8) | 0x02), -202 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1309 |
0x025b, ((0x00 << 8) | 0x02), -203 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1310 |
0x0260, ((0x00 << 8) | 0x05), -205 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1311 |
0x0263, ((0x00 << 8) | 0x03), -207 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1312 |
0x0268, ((0x00 << 8) | 0x05), -209 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1313 |
0x0269, ((0x06 << 8) | 0x06), -211 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1314 |
0x0272, ((0x00 << 8) | 0x03), -213 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1315 |
0x0275, ((0x00 << 8) | 0x03), -214 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1316 |
0x0280, ((0x03 << 8) | 0x03), -218 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1317 |
0x0288, ((0x00 << 8) | 0x05), -218 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1318 |
0x028a, ((0x01 << 8) | 0x01), -217 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1319 |
0x0292, ((0x00 << 8) | 0x07), -219 , |
8004
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1320 |
0x0345, ((0x00 << 8) | 0xb3), 0x0054 , |
8022
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1321 |
0x03ac, ((0x00 << 8) | 0x67), -38 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1322 |
0x03ad, ((0x02 << 8) | 0x01), -37 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1323 |
0x03b1, ((0x10 << 8) | 0x01), -32 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1324 |
0x03c2, ((0x00 << 8) | 0x01), -31 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1325 |
0x03c3, ((0x08 << 8) | 0x01), -32 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1326 |
0x03cc, ((0x00 << 8) | 0x01), -64 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1327 |
0x03cd, ((0x01 << 8) | 0x01), -63 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1328 |
0x03d0, ((0x00 << 8) | 0x02), -62 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1329 |
0x03d1, ((0x00 << 8) | 0x01), -57 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1330 |
0x03d5, ((0x00 << 8) | 0x04), -47 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1331 |
0x03d6, ((0x00 << 8) | 0x01), -54 , |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
1332 |
#ifndef UNICODE_3_2 |
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
1333 |
0x03d9, ((0x00 << 8) | 0x00), -1 , /* Unicode4.0 - not in X fonts - sigh */ |
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
1334 |
#endif |
8022
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1335 |
0x03db, ((0x14 << 8) | 0x02), -1 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1336 |
0x03f0, ((0x00 << 8) | 0x01), -86 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1337 |
0x03f1, ((0x00 << 8) | 0x01), -80 , |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
1338 |
#ifdef UNICODE_3_2 |
8022
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1339 |
0x03f2, ((0x00 << 8) | 0x01), -79 , |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
1340 |
#else |
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
1341 |
0x03f2, ((0x00 << 8) | 0x00), 7 , /* Unicode4.0 - not in X fonts - sigh */ |
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
1342 |
#endif |
8022
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1343 |
0x03f5, ((0x00 << 8) | 0x00), -96 , |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
1344 |
#ifndef UNICODE_3_2 |
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
1345 |
0x03f8, ((0x03 << 8) | 0x03), -1 , /* Unicode4.0 - not in X fonts - sigh */ |
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
1346 |
#endif |
8022
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1347 |
0x0430, ((0x1f << 8) | 0x01), -32 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1348 |
0x0450, ((0x0f << 8) | 0x01), -80 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1349 |
0x0461, ((0x20 << 8) | 0x02), -1 , |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
1350 |
#ifndef UNICODE_3_2 |
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
1351 |
0x048b, ((0x00 << 8) | 0x00), -1 , /* Unicode4.0 - not in X fonts - sigh */ |
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
1352 |
#endif |
8022
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1353 |
0x048d, ((0x32 << 8) | 0x02), -1 , |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
1354 |
#ifdef UNICODE_3_2 |
8022
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1355 |
0x04c2, ((0x02 << 8) | 0x02), -1 , |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
1356 |
#else |
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
1357 |
0x04c2, ((0x04 << 8) | 0x02), -1 , /* Unicode4.0 - not in X fonts - sigh */ |
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
1358 |
#endif |
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
1359 |
#ifdef UNICODE_3_2 |
8022
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1360 |
0x04c8, ((0x04 << 8) | 0x04), -1 , |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
1361 |
#else |
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
1362 |
0x04c8, ((0x04 << 8) | 0x02), -1 , |
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
1363 |
0x04ce, ((0x00 << 8) | 0x00), -1 , |
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
1364 |
#endif |
8022
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1365 |
0x04d1, ((0x24 << 8) | 0x02), -1 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1366 |
0x04f9, ((0x00 << 8) | 0x04), -1 , |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
1367 |
#ifndef UNICODE_3_2 |
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
1368 |
0x0501, ((0x0E << 8) | 0x02), -1 , |
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
1369 |
#endif |
8022
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1370 |
0x0561, ((0x25 << 8) | 0x01), -48 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1371 |
0x1e01, ((0x94 << 8) | 0x02), -1 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1372 |
0x1e9b, ((0x00 << 8) | 0x06), -59 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1373 |
0x1ea1, ((0x58 << 8) | 0x02), -1 , |
8004
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1374 |
0x1f00, ((0x07 << 8) | 0x01), 0x0008 , |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1375 |
0x1f10, ((0x05 << 8) | 0x01), 0x0008 , |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1376 |
0x1f20, ((0x07 << 8) | 0x01), 0x0008 , |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1377 |
0x1f30, ((0x07 << 8) | 0x01), 0x0008 , |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1378 |
0x1f40, ((0x05 << 8) | 0x01), 0x0008 , |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1379 |
0x1f51, ((0x06 << 8) | 0x02), 0x0008 , |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1380 |
0x1f60, ((0x07 << 8) | 0x01), 0x0008 , |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1381 |
0x1f70, ((0x01 << 8) | 0x01), 0x004a , |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1382 |
0x1f72, ((0x03 << 8) | 0x01), 0x0056 , |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1383 |
0x1f76, ((0x01 << 8) | 0x01), 0x0064 , |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1384 |
0x1f78, ((0x01 << 8) | 0x01), 0x0080 , |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1385 |
0x1f7a, ((0x01 << 8) | 0x01), 0x0070 , |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1386 |
0x1f7c, ((0x01 << 8) | 0x01), 0x007e , |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1387 |
0x1f80, ((0x07 << 8) | 0x01), 0x0008 , |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1388 |
0x1f90, ((0x07 << 8) | 0x01), 0x0008 , |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1389 |
0x1fa0, ((0x07 << 8) | 0x01), 0x0008 , |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1390 |
0x1fb0, ((0x01 << 8) | 0x01), 0x0008 , |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1391 |
0x1fb3, ((0x00 << 8) | 0x02), 0x0009 , |
8022
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1392 |
0x1fbe, ((0x00 << 8) | 0x0b), -7205 , |
8004
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1393 |
0x1fc3, ((0x00 << 8) | 0x05), 0x0009 , |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1394 |
0x1fd0, ((0x01 << 8) | 0x01), 0x0008 , |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1395 |
0x1fe0, ((0x01 << 8) | 0x01), 0x0008 , |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1396 |
0x1fe5, ((0x00 << 8) | 0x04), 0x0007 , |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1397 |
0x1ff3, ((0x00 << 8) | 0x0e), 0x0009 , |
8022
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1398 |
0x2170, ((0x0f << 8) | 0x01), -16 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1399 |
0x24d0, ((0x19 << 8) | 0x01), -26 , |
9153 | 1400 |
0xff41, ((0x19 << 8) | 0x01), -32 , |
1401 |
0x10428, ((0x27 << 8) | 0x01), -40 |
|
8004
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1402 |
}; |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1403 |
|
14684 | 1404 |
REGISTER unsigned INT __codePoint; |
8308 | 1405 |
REGISTER int *__p; |
8004
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1406 |
|
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1407 |
__codePoint = __intVal(__INST(asciivalue)); |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1408 |
|
18691 | 1409 |
// comon ascii stuff first |
1410 |
if (__codePoint < 0x80) { |
|
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1411 |
if ((__codePoint >= 'a') && (__codePoint <= 'z')) { |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1412 |
unsigned newCodePoint; |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1413 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1414 |
newCodePoint = __codePoint - 'a' + 'A'; |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1415 |
RETURN (__MKCHARACTER(newCodePoint)) ; |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1416 |
} |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1417 |
RETURN (self); |
18691 | 1418 |
} |
1419 |
||
8106
ee222c1314e6
cannot make pointer arith with a void *
Claus Gittinger <cg@exept.de>
parents:
8100
diff
changeset
|
1420 |
for (__p = __mapping; (char *)__p < ((char *)__mapping) + sizeof(__mapping); __p += 3) { |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1421 |
unsigned rangeStart, rangeSize, rangeEnd, mod; |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1422 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1423 |
rangeStart = (unsigned)__p[0]; |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1424 |
if (rangeStart > __codePoint) break; |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1425 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1426 |
rangeSize = ((unsigned)__p[1]) >> 8; |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1427 |
rangeEnd = rangeStart + rangeSize; |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1428 |
if (__codePoint <= rangeEnd) { |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1429 |
mod = __p[1] & 0xFF; |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1430 |
if ((mod == 0) || (((__codePoint - rangeStart) % mod) == 0)) { |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1431 |
OBJ newChar; |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1432 |
unsigned newCodePoint; |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1433 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1434 |
newCodePoint = __codePoint + __p[2]; |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1435 |
if (newCodePoint <= MAX_IMMEDIATE_CHARACTER) { |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1436 |
RETURN (__MKCHARACTER(newCodePoint)) ; |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1437 |
} |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1438 |
newChar = __MKUCHARACTER(newCodePoint) ; |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1439 |
if (newChar == nil) goto allocationError; |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1440 |
RETURN (newChar) ; |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1441 |
} |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1442 |
} |
8004
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1443 |
} |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1444 |
RETURN (self); |
8022
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1445 |
allocationError: ; |
18240
28af09029a8b
ifdef for SCHTEAM engine changed (not relevant for ST/X)
Claus Gittinger <cg@exept.de>
parents:
18215
diff
changeset
|
1446 |
#endif /* ! __SCHTEAM__ */ |
8004
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1447 |
%}. |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1448 |
^ AllocationFailure raise. |
8004
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1449 |
|
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1450 |
" |
9153 | 1451 |
$A asLowercase |
1452 |
$a asUppercase |
|
1453 |
(Character value:16r01F5) asUppercase |
|
1454 |
(Character value:16r0205) asUppercase |
|
1455 |
(Character value:16r03B1) asUppercase |
|
1456 |
" |
|
8010 | 1457 |
! |
8004
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1458 |
|
8010 | 1459 |
digitValue |
11653 | 1460 |
"return my digitValue for any base (up to 37)" |
8010 | 1461 |
|
8143 | 1462 |
|code "{ Class: SmallInteger }" | |
1463 |
||
1464 |
code := asciivalue. |
|
1465 |
(code between:($0 codePoint) and:($9 codePoint)) ifTrue:[ |
|
14684 | 1466 |
^ code - $0 codePoint |
8010 | 1467 |
]. |
8143 | 1468 |
(code between:($a codePoint) and:($z codePoint)) ifTrue:[ |
14684 | 1469 |
^ code + (10 - $a codePoint) |
9153 | 1470 |
]. |
8143 | 1471 |
(code between:($A codePoint) and:($Z codePoint)) ifTrue:[ |
14684 | 1472 |
^ code + (10 - $A codePoint) |
9153 | 1473 |
]. |
8004
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1474 |
|
8010 | 1475 |
"remove error below for X3J20 conformance ... " |
1476 |
self error:'bad character'. |
|
1477 |
" " |
|
1478 |
^ -1 |
|
1479 |
! |
|
1480 |
||
11653 | 1481 |
digitValueRadix:base |
1482 |
"return my digitValue for base. |
|
1483 |
Return nil, if it is not a valid character for that base" |
|
1484 |
||
1485 |
|code "{ Class: SmallInteger }" | |
|
1486 |
||
1487 |
code := asciivalue. |
|
1488 |
base < 10 ifTrue:[ |
|
14684 | 1489 |
(code between:($0 codePoint) and:($0 codePoint + base - 1)) ifTrue:[ |
1490 |
^ code - $0 codePoint |
|
1491 |
]. |
|
1492 |
^ nil. |
|
11653 | 1493 |
]. |
1494 |
(code between:($0 codePoint) and:($9 codePoint)) ifTrue:[ |
|
14684 | 1495 |
^ code - $0 codePoint |
11653 | 1496 |
]. |
1497 |
base <= 10 ifTrue:[ |
|
14684 | 1498 |
^ nil. |
11653 | 1499 |
]. |
1500 |
(code between:($a codePoint) and:($a codePoint + base - 1 - 10)) ifTrue:[ |
|
14684 | 1501 |
^ code + (10 - $a codePoint) |
11653 | 1502 |
]. |
1503 |
(code between:($A codePoint) and:($A codePoint + base - 1 - 10)) ifTrue:[ |
|
14684 | 1504 |
^ code + (10 - $A codePoint) |
11653 | 1505 |
]. |
1506 |
^ nil |
|
1507 |
||
1508 |
" |
|
14684 | 1509 |
self assert:($0 digitValueRadix:10) == 0. |
11653 | 1510 |
self assert:($9 digitValueRadix:10) == 9. |
1511 |
self assert:($a digitValueRadix:10) == nil. |
|
1512 |
self assert:($a digitValueRadix:11) == 10. |
|
1513 |
self assert:($A digitValueRadix:11) == 10. |
|
1514 |
self assert:($a digitValueRadix:16) == 10. |
|
1515 |
self assert:($A digitValueRadix:16) == 10. |
|
1516 |
self assert:($f digitValueRadix:16) == 15. |
|
1517 |
self assert:($F digitValueRadix:16) == 15. |
|
1518 |
self assert:($g digitValueRadix:16) == nil. |
|
1519 |
self assert:($G digitValueRadix:16) == nil. |
|
1520 |
self assert:($g digitValueRadix:17) == 16. |
|
1521 |
self assert:($G digitValueRadix:17) == 16. |
|
1522 |
" |
|
1523 |
! |
|
1524 |
||
8010 | 1525 |
literalArrayEncoding |
1526 |
"encode myself as an array literal, from which a copy of the receiver |
|
1527 |
can be reconstructed with #decodeAsLiteralArray." |
|
1528 |
||
1529 |
^ self |
|
1530 |
||
1531 |
"Created: / 27.10.1997 / 14:40:37 / cg" |
|
1532 |
! |
|
1533 |
||
1534 |
to:aMagnitude |
|
9153 | 1535 |
"Return an Interval over the characters from the receiver to <aMagnitude>. |
21520 | 1536 |
Wrap <aMagnitude> if it is not a legal Character value. (JS) |
1537 |
CG: why wrap - is this a good idea?" |
|
8010 | 1538 |
|
10936
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
1539 |
^ Interval from:self to:(aMagnitude \\ 16r3FFFFFFF) |
21520 | 1540 |
|
1541 |
"Modified (comment): / 22-02-2017 / 10:56:38 / cg" |
|
8004
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1542 |
! |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1543 |
|
13499 | 1544 |
to:aMagnitude by:inc |
1545 |
"Return an Interval over the characters from the receiver to <aMagnitude>. |
|
21519 | 1546 |
Wrap <aMagnitude> if it is not a legal Character value. (JS) |
1547 |
CG: why wrap - is this a good idea?" |
|
13499 | 1548 |
|
1549 |
^ Interval from:self to:(aMagnitude \\ 16r3FFFFFFF) by:inc |
|
1550 |
||
1551 |
"Created: / 04-07-2011 / 19:35:15 / cg" |
|
21519 | 1552 |
"Modified (comment): / 22-02-2017 / 10:48:42 / cg" |
13499 | 1553 |
! |
1554 |
||
5847 | 1555 |
utf8Encoded |
11321 | 1556 |
"convert a character to its UTF-8 encoding. |
5847 | 1557 |
this returns a String" |
1558 |
||
1559 |
|s| |
|
1560 |
||
7897 | 1561 |
asciivalue <= 16r7F ifTrue:[ |
21374 | 1562 |
^ self asString. |
7897 | 1563 |
]. |
1564 |
||
21374 | 1565 |
s := WriteStream on:(String new:self utf8BytesPerCharacter). |
11321 | 1566 |
s nextPutUtf8:self. |
5847 | 1567 |
^ s contents |
9153 | 1568 |
|
5847 | 1569 |
" |
23950 | 1570 |
'ä' utf8Encoded |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1571 |
'a' utf8Encoded |
5847 | 1572 |
" |
21374 | 1573 |
|
1574 |
"Modified: / 07-02-2017 / 14:37:06 / stefan" |
|
21673 | 1575 |
! |
1576 |
||
1577 |
withoutDiacritics |
|
23852 | 1578 |
<resource: #todo> |
21673 | 1579 |
"return a character with same letter as the receiver, but in without diacritics modifiers |
23950 | 1580 |
(mapping e.g. Ä to A). |
21673 | 1581 |
Returns the receiver if it has no diacritics modifiers." |
1582 |
||
1583 |
^ self shouldImplement |
|
1584 |
||
1585 |
"Created: / 28-03-2017 / 16:01:45 / stefan" |
|
699 | 1586 |
! ! |
1587 |
||
1588 |
!Character methodsFor:'copying'! |
|
1589 |
||
15984 | 1590 |
, aStringOrCharacter |
1591 |
"return a string containing the concatenation of the receiver character |
|
1592 |
and the argument, a string or character. |
|
1593 |
Added for symetry, as we allow string,char also char,string should be allowed" |
|
1594 |
||
16074 | 1595 |
%{ |
1596 |
OBJ s; |
|
1597 |
unsigned INT val; |
|
1598 |
||
1599 |
// fast code for common cases |
|
1600 |
val = __intVal(__characterVal(self)); |
|
1601 |
if (val <= 0xFF) { |
|
23950 | 1602 |
if (__isCharacter(aStringOrCharacter)) { |
1603 |
unsigned INT val2 = __intVal(__characterVal(aStringOrCharacter)); |
|
1604 |
||
1605 |
if (val2 <= 0xFF) { |
|
1606 |
char buffer[2]; |
|
1607 |
||
1608 |
buffer[0] = val; |
|
1609 |
buffer[1] = val2; |
|
1610 |
s = __MKSTRING_L(buffer, 2); |
|
1611 |
if (s != nil) { |
|
1612 |
RETURN (s); |
|
1613 |
} |
|
1614 |
} |
|
1615 |
} else { |
|
1616 |
if (__isStringLike(aStringOrCharacter)) { |
|
1617 |
int strSize = __stringSize(aStringOrCharacter); |
|
1618 |
||
1619 |
s = __MKEMPTYSTRING(strSize+1); |
|
1620 |
if (s != nil) { |
|
1621 |
__StringInstPtr(s)->s_element[0] = val; |
|
1622 |
memcpy(__StringInstPtr(s)->s_element+1, __stringVal(aStringOrCharacter), strSize+1); // copies 0-byte too |
|
1623 |
RETURN (s); |
|
1624 |
} |
|
1625 |
} |
|
1626 |
} |
|
16074 | 1627 |
} |
1628 |
%}. |
|
15984 | 1629 |
^ self asString , aStringOrCharacter |
1630 |
||
1631 |
" |
|
1632 |
$. , $: |
|
1633 |
$. , 'abc' , $. |
|
16074 | 1634 |
|
1635 |
Time millisecondsToRun:[ 10000000 timesRepeat:[ $a , $b ]] |
|
1636 |
Time millisecondsToRun:[ 10000000 timesRepeat:[ $a , 'b' ]] |
|
1637 |
Time millisecondsToRun:[ 10000000 timesRepeat:[ 'a' , 'b' ]] |
|
1638 |
Time millisecondsToRun:[ 10000000 timesRepeat:[ 'a' , $b ]] |
|
15984 | 1639 |
" |
23950 | 1640 |
|
1641 |
"Modified: / 22-03-2019 / 03:00:09 / Claus Gittinger" |
|
15984 | 1642 |
! |
1643 |
||
699 | 1644 |
copy |
1645 |
"return a copy of myself |
|
1646 |
reimplemented since characters are unique" |
|
1647 |
||
1648 |
^ self |
|
1649 |
! |
|
1650 |
||
10948 | 1651 |
deepCopyUsing:aDictionary postCopySelector:postCopySelector |
699 | 1652 |
"return a deep copy of myself |
4728 | 1653 |
reimplemented since characters are immutable" |
699 | 1654 |
|
1655 |
^ self |
|
1656 |
! |
|
1657 |
||
1658 |
shallowCopy |
|
1659 |
"return a shallow copy of myself |
|
4728 | 1660 |
reimplemented since characters are immutable" |
699 | 1661 |
|
1662 |
^ self |
|
1663 |
! |
|
1664 |
||
1665 |
simpleDeepCopy |
|
1666 |
"return a deep copy of myself |
|
4728 | 1667 |
reimplemented since characters are immutable" |
699 | 1668 |
|
1669 |
^ self |
|
1670 |
! ! |
|
1671 |
||
23555 | 1672 |
!Character methodsFor:'dependents access'! |
1673 |
||
1674 |
addDependent:someOne |
|
1675 |
"It doesn't make sense to add dependents to a shared instance. |
|
1676 |
Silently ignore ..." |
|
1677 |
||
1678 |
"/ Transcript show:'*** trying to make dependent on an character: '. |
|
1679 |
"/ thisContext sender printOn:Transcript. Transcript cr. |
|
1680 |
||
1681 |
"Created: / 30-11-2018 / 18:05:34 / Stefan Vogel" |
|
1682 |
"Modified (comment): / 03-12-2018 / 17:52:28 / Stefan Vogel" |
|
1683 |
! |
|
1684 |
||
1685 |
onChangeSend:selector to:someOne |
|
1686 |
"It doesn't make sense to add dependents to a shared instance. |
|
1687 |
Silently ignore ..." |
|
1688 |
||
1689 |
"/ Transcript show:'*** trying to make dependent on an character: '. |
|
1690 |
"/ thisContext sender printOn:Transcript. Transcript cr. |
|
1691 |
||
1692 |
"Created: / 30-11-2018 / 18:06:26 / Stefan Vogel" |
|
1693 |
"Modified (comment): / 03-12-2018 / 17:52:36 / Stefan Vogel" |
|
1694 |
! ! |
|
1695 |
||
5471
a57eeb01c5ab
General encoding method (#encodeOn:with:)
Stefan Vogel <sv@exept.de>
parents:
5452
diff
changeset
|
1696 |
!Character methodsFor:'encoding'! |
a57eeb01c5ab
General encoding method (#encodeOn:with:)
Stefan Vogel <sv@exept.de>
parents:
5452
diff
changeset
|
1697 |
|
6508 | 1698 |
rot13 |
9153 | 1699 |
"Usenet: from `rotate alphabet 13 places'] |
6508 | 1700 |
The simple Caesar-cypher encryption that replaces each English |
9153 | 1701 |
letter with the one 13 places forward or back along the alphabet, |
6508 | 1702 |
so that 'The butler did it!!' becomes 'Gur ohgyre qvq vg!!' |
9153 | 1703 |
Most Usenet news reading and posting programs include a rot13 feature. |
6508 | 1704 |
It is used to enclose the text in a sealed wrapper that the reader must choose |
9153 | 1705 |
to open -- e.g., for posting things that might offend some readers, or spoilers. |
6508 | 1706 |
A major advantage of rot13 over rot(N) for other N is that it |
1707 |
is self-inverse, so the same code can be used for encoding and decoding." |
|
1708 |
||
11864 | 1709 |
^ self rot:13 |
6508 | 1710 |
|
1711 |
" |
|
9153 | 1712 |
$h rot13 |
1713 |
$h rot13 rot13 |
|
7715
0e69a830f5d8
use #and: - not #& you lazy bone, you
Claus Gittinger <cg@exept.de>
parents:
7689
diff
changeset
|
1714 |
'The butler did it!!' rot13 -> 'Gur ohgyre qvq vg!!' |
0e69a830f5d8
use #and: - not #& you lazy bone, you
Claus Gittinger <cg@exept.de>
parents:
7689
diff
changeset
|
1715 |
'The butler did it!!' rot13 rot13 -> 'The butler did it!!' |
6508 | 1716 |
" |
11864 | 1717 |
! |
1718 |
||
1719 |
rot:n |
|
1720 |
"Usenet: from `rotate alphabet N places'] |
|
1721 |
The simple Caesar-cypher encryption that replaces each English |
|
1722 |
letter with the one N places forward or back along the alphabet, |
|
1723 |
so that 'The butler did it!!' becomes 'Gur ohgyre qvq vg!!' by rot:13 |
|
1724 |
Most Usenet news reading and posting programs include a rot13 feature. |
|
1725 |
It is used to enclose the text in a sealed wrapper that the reader must choose |
|
1726 |
to open -- e.g., for posting things that might offend some readers, or spoilers. |
|
1727 |
A major advantage of rot13 over rot(N) for other N is that it |
|
1728 |
is self-inverse, so the same code can be used for encoding and decoding." |
|
1729 |
||
1730 |
(self isLetter) ifTrue:[ |
|
14684 | 1731 |
self isLowercase ifTrue:[ |
1732 |
^ 'abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz' at:(self-$a+1+n) |
|
1733 |
]. |
|
1734 |
^ 'ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ' at:(self-$A+1+n) |
|
11864 | 1735 |
]. |
1736 |
^ self |
|
1737 |
||
1738 |
" |
|
1739 |
'The butler did it!!' rot:13 -> 'Gur ohgyre qvq vg!!' |
|
1740 |
('The butler did it!!' rot:13) rot:13 -> 'The butler did it!!' |
|
1741 |
" |
|
5471
a57eeb01c5ab
General encoding method (#encodeOn:with:)
Stefan Vogel <sv@exept.de>
parents:
5452
diff
changeset
|
1742 |
! ! |
a57eeb01c5ab
General encoding method (#encodeOn:with:)
Stefan Vogel <sv@exept.de>
parents:
5452
diff
changeset
|
1743 |
|
10428 | 1744 |
|
8143 | 1745 |
!Character methodsFor:'obsolete'! |
1746 |
||
1747 |
asciiValue |
|
1748 |
"return the asciivalue of myself. |
|
1749 |
The name 'asciiValue' is a historic leftover: |
|
9153 | 1750 |
characters are not limited to 8bit characters. |
8143 | 1751 |
So the actual value returned is a codePoint (i.e. full potential for 31bit encoding). |
1752 |
PP has removed this method with 4.1 and providing asInteger instead. |
|
1753 |
ANSI defines #codePoint, please use this method" |
|
1754 |
||
1755 |
<resource:#obsolete> |
|
1756 |
||
1757 |
^ asciivalue |
|
1758 |
||
1759 |
"Modified: 27.6.1996 / 12:34:34 / cg" |
|
1760 |
! ! |
|
1761 |
||
699 | 1762 |
!Character methodsFor:'printing & storing'! |
1763 |
||
14117 | 1764 |
displayOn:aGCOrStream |
14120
fdf215af772c
added: #displayOn: (instead of #displaySting)
Stefan Vogel <sv@exept.de>
parents:
14117
diff
changeset
|
1765 |
"Compatibility |
fdf215af772c
added: #displayOn: (instead of #displaySting)
Stefan Vogel <sv@exept.de>
parents:
14117
diff
changeset
|
1766 |
append a printed desription on some stream (Dolphin, Squeak) |
fdf215af772c
added: #displayOn: (instead of #displaySting)
Stefan Vogel <sv@exept.de>
parents:
14117
diff
changeset
|
1767 |
OR: |
fdf215af772c
added: #displayOn: (instead of #displaySting)
Stefan Vogel <sv@exept.de>
parents:
14117
diff
changeset
|
1768 |
display the receiver in a graphicsContext at 0@0 (ST80). |
fdf215af772c
added: #displayOn: (instead of #displaySting)
Stefan Vogel <sv@exept.de>
parents:
14117
diff
changeset
|
1769 |
This method allows for any object to be displayed in some view |
fdf215af772c
added: #displayOn: (instead of #displaySting)
Stefan Vogel <sv@exept.de>
parents:
14117
diff
changeset
|
1770 |
(although the fallBack is to display its printString ...)" |
699 | 1771 |
|
14117 | 1772 |
"/ what a kludge - Dolphin and Squeak mean: printOn: a stream; |
21535 | 1773 |
"/ old ST80 means: draw-yourself on a GC. |
16744 | 1774 |
(aGCOrStream isStream) ifFalse:[ |
21484 | 1775 |
^ super displayOn:aGCOrStream |
14117 | 1776 |
]. |
1777 |
||
1778 |
self storeOn:aGCOrStream. |
|
1779 |
aGCOrStream nextPutAll:' "16r'. |
|
1780 |
asciivalue printOn:aGCOrStream base:16. |
|
21484 | 1781 |
aGCOrStream space. |
19195 | 1782 |
asciivalue printOn:aGCOrStream. |
14117 | 1783 |
aGCOrStream nextPut:$". |
21484 | 1784 |
|
1785 |
"Modified: / 17-02-2017 / 10:53:26 / stefan" |
|
21535 | 1786 |
"Modified (comment): / 22-02-2017 / 16:49:35 / cg" |
699 | 1787 |
! |
1788 |
||
1789 |
isLiteral |
|
4655
b9405ca0bb4e
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4340
diff
changeset
|
1790 |
"return true, if the receiver can be used as a literal constant in ST syntax |
699 | 1791 |
(i.e. can be used in constant arrays)" |
1792 |
||
1793 |
^ true |
|
1794 |
! |
|
1795 |
||
1796 |
||
5746
cf5e42cb72ef
do not overwrite the standard printing conventions
Claus Gittinger <cg@exept.de>
parents:
5566
diff
changeset
|
1797 |
"print myself on stdout. |
19378 | 1798 |
If Stdout is nil, this method does NOT (by purpose) use the stream classes and |
1799 |
will therefore work even in case of emergency or very early startup (but only, if Stdout is nil)." |
|
699 | 1800 |
|
1801 |
%{ /* NOCONTEXT */ |
|
1802 |
||
5746
cf5e42cb72ef
do not overwrite the standard printing conventions
Claus Gittinger <cg@exept.de>
parents:
5566
diff
changeset
|
1803 |
if (@global(Stdout) == nil) { |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1804 |
putchar(__intVal(__INST(asciivalue))); |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1805 |
RETURN(self); |
5746
cf5e42cb72ef
do not overwrite the standard printing conventions
Claus Gittinger <cg@exept.de>
parents:
5566
diff
changeset
|
1806 |
} |
5452
71fd110c347a
allow print, printCR during early initialization
Claus Gittinger <cg@exept.de>
parents:
5433
diff
changeset
|
1807 |
%}. |
71fd110c347a
allow print, printCR during early initialization
Claus Gittinger <cg@exept.de>
parents:
5433
diff
changeset
|
1808 |
super print |
699 | 1809 |
! |
1810 |
||
1811 |
printOn:aStream |
|
1812 |
"print myself on aStream" |
|
1813 |
||
1814 |
aStream nextPut:self |
|
1815 |
! |
|
1816 |
||
1817 |
printString |
|
1818 |
"return a string to print me" |
|
1819 |
||
1820 |
^ self asString |
|
1821 |
! |
|
1822 |
||
1823 |
storeOn:aStream |
|
1824 |
"store myself on aStream" |
|
1825 |
||
1826 |
|special| |
|
1827 |
||
10936
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
1828 |
(asciivalue between:33 and:127) ifTrue:[ |
23778 | 1829 |
aStream nextPut:$$; nextPut:self |
10936
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
1830 |
] ifFalse:[ |
23778 | 1831 |
(self == Character space) ifTrue:[ |
1832 |
special := #space |
|
1833 |
] ifFalse:[(self == Character cr) ifTrue:[ |
|
1834 |
special := #cr. |
|
1835 |
] ifFalse:[(self == Character return) ifTrue:[ |
|
1836 |
special := #return. |
|
1837 |
] ifFalse:[(self == Character tab) ifTrue:[ |
|
1838 |
special := #tab. |
|
1839 |
] ifFalse:[(self == Character esc) ifTrue:[ |
|
1840 |
special := #esc. |
|
1841 |
]]]]]. |
|
1842 |
||
1843 |
special notNil ifTrue:[ |
|
1844 |
aStream nextPutAll:'(Character '; nextPutAll:special; nextPut:$). |
|
1845 |
^ self |
|
1846 |
]. |
|
1847 |
aStream nextPutAll:'(Character codePoint:16r'. |
|
1848 |
asciivalue printOn:aStream base:16. |
|
1849 |
aStream nextPut:$) |
|
10936
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
1850 |
]. |
995
b018368b3a94
asString to 16-bit char should return a twoByteString
Claus Gittinger <cg@exept.de>
parents:
819
diff
changeset
|
1851 |
|
23778 | 1852 |
"Modified: / 23-02-1996 / 23:27:32 / cg" |
1853 |
"Modified: / 20-01-1998 / 14:10:46 / stefan" |
|
1854 |
"Modified: / 27-02-2019 / 15:13:09 / Stefan Vogel" |
|
699 | 1855 |
! ! |
1856 |
||
7257 | 1857 |
!Character methodsFor:'private-accessing'! |
699 | 1858 |
|
8100 | 1859 |
setCodePoint:anInteger |
9153 | 1860 |
"very private - set the codePoint. |
10936
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
1861 |
- use this only for newly created characters with codes > MAX_IMMEDIATE_CHARACTER. |
9153 | 1862 |
DANGER alert: |
1863 |
funny things happen, if this is applied to |
|
10936
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
1864 |
one of the shared characters with codePoints 0..MAX_IMMEDIATE_CHARACTER." |
699 | 1865 |
|
1866 |
asciivalue := anInteger |
|
1867 |
! ! |
|
1868 |
||
8004
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1869 |
!Character methodsFor:'queries'! |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1870 |
|
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1871 |
bitsPerCharacter |
20698 | 1872 |
"return the number of bits I require for storage. |
1873 |
(i.e. am I an Ascii/ISO8859-1 Character or will I need more |
|
1874 |
bits for storage." |
|
8004
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1875 |
|
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1876 |
asciivalue <= 16rFF ifTrue:[^ 8]. |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1877 |
asciivalue <= 16rFFFF ifTrue:[^ 16]. |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1878 |
^ 32 |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1879 |
! |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1880 |
|
19756 | 1881 |
bytesPerCharacter |
1882 |
"return the number of bytes I require for storage" |
|
1883 |
||
1884 |
asciivalue <= 16rFF ifTrue:[^ 1]. |
|
1885 |
asciivalue <= 16rFFFF ifTrue:[^ 2]. |
|
1886 |
^ 4 |
|
21374 | 1887 |
|
1888 |
"Modified: / 07-02-2017 / 14:36:05 / stefan" |
|
19756 | 1889 |
! |
1890 |
||
18595 | 1891 |
characterSize |
18588 | 1892 |
"return the number of bits I require for storage. |
1893 |
Protocol compatibility with CharacterArray." |
|
18656
fab035561c68
fix: assign instead of compare
Claus Gittinger <cg@exept.de>
parents:
18605
diff
changeset
|
1894 |
|
18595 | 1895 |
asciivalue <= 16r80 ifTrue:[ |
18656
fab035561c68
fix: assign instead of compare
Claus Gittinger <cg@exept.de>
parents:
18605
diff
changeset
|
1896 |
^ 7 |
18595 | 1897 |
]. |
18588 | 1898 |
asciivalue <= 16rFF ifTrue:[ |
18656
fab035561c68
fix: assign instead of compare
Claus Gittinger <cg@exept.de>
parents:
18605
diff
changeset
|
1899 |
^ 8 |
18588 | 1900 |
]. |
1901 |
asciivalue <= 16rFFFF ifTrue:[ |
|
18656
fab035561c68
fix: assign instead of compare
Claus Gittinger <cg@exept.de>
parents:
18605
diff
changeset
|
1902 |
^ 16 |
18588 | 1903 |
]. |
1904 |
^ 32 |
|
1905 |
! |
|
1906 |
||
8004
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1907 |
stringSpecies |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1908 |
"return the type of string that is needed to store me" |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1909 |
|
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1910 |
asciivalue <= 16rFF ifTrue:[^ String]. |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1911 |
asciivalue <= 16rFFFF ifTrue:[^ Unicode16String]. |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1912 |
^ Unicode32String |
20015 | 1913 |
! |
1914 |
||
1915 |
unicodeBlock |
|
20016 | 1916 |
"return the name of the unicode block in which this character is. |
1917 |
incomplete" |
|
20015 | 1918 |
|
1919 |
asciivalue <= 16r007F ifTrue:[^ #BASIC_LATIN ]. |
|
1920 |
asciivalue <= 16r00FF ifTrue:[^ #LATIN1_SUPPLEMENT ]. |
|
1921 |
asciivalue <= 16r017F ifTrue:[^ #LATIN1_EXTENDED_A]. |
|
1922 |
asciivalue <= 16r024F ifTrue:[^ #LATIN1_EXTENDED_B]. |
|
1923 |
asciivalue <= 16r02AF ifTrue:[^ #IPA_EXTENSIONS]. |
|
1924 |
asciivalue <= 16r02FF ifTrue:[^ #SPACING_MODIFIER_LETTERS]. |
|
1925 |
asciivalue <= 16r036f ifTrue:[ ^ #COMBINING_DIACRITICAL_MARKS ]. |
|
1926 |
asciivalue <= 16r03FF ifTrue:[ ^ #GREEK_AND_COPTIC ]. |
|
1927 |
asciivalue <= 16r04FF ifTrue:[ ^ #CYRILLIC ]. |
|
1928 |
asciivalue <= 16r052F ifTrue:[ ^ #CYRILLIC_SUPPLEMENT ]. |
|
1929 |
asciivalue <= 16r058F ifTrue:[ ^ #ARMENIAN ]. |
|
1930 |
asciivalue <= 16r05FF ifTrue:[ ^ #HEBREW ]. |
|
1931 |
asciivalue <= 16r06FF ifTrue:[ ^ #ARABIC ]. |
|
1932 |
asciivalue <= 16r074F ifTrue:[ ^ #SYRIAC ]. |
|
1933 |
asciivalue <= 16r077F ifTrue:[ ^ #ARABIC_SUPPLEMENT ]. |
|
1934 |
asciivalue <= 16r07BF ifTrue:[ ^ #THAANA ]. |
|
1935 |
asciivalue <= 16r07FF ifTrue:[ ^ #NKO ]. |
|
1936 |
asciivalue <= 16r083F ifTrue:[ ^ #SAMARITAN ]. |
|
1937 |
asciivalue <= 16r085F ifTrue:[ ^ #MANDAIC ]. |
|
1938 |
asciivalue <= 16r087F ifTrue:[ ^ nil ]. |
|
1939 |
asciivalue <= 16r08FF ifTrue:[ ^ #ARABIC_EXTENDED_A ]. |
|
1940 |
asciivalue <= 16r097F ifTrue:[ ^ #DEVANAGARI ]. |
|
1941 |
asciivalue <= 16r09FF ifTrue:[ ^ #BENGALI ]. |
|
1942 |
asciivalue <= 16r0A7F ifTrue:[ ^ #GURMUKHI ]. |
|
1943 |
asciivalue <= 16r0AFF ifTrue:[ ^ #GUJARATI ]. |
|
1944 |
asciivalue <= 16r0B7F ifTrue:[ ^ #ORIYA ]. |
|
1945 |
asciivalue <= 16r0BFF ifTrue:[ ^ #TAMIL ]. |
|
1946 |
asciivalue <= 16r0C7F ifTrue:[ ^ #TELUGU ]. |
|
1947 |
asciivalue <= 16r0CFF ifTrue:[ ^ #KANNADA ]. |
|
1948 |
asciivalue <= 16r0D7F ifTrue:[ ^ #MALAYALAM ]. |
|
1949 |
asciivalue <= 16r0DFF ifTrue:[ ^ #SINHALA ]. |
|
1950 |
asciivalue <= 16r0E7F ifTrue:[ ^ #THAI ]. |
|
1951 |
asciivalue <= 16r0EFF ifTrue:[ ^ #LAO ]. |
|
1952 |
asciivalue <= 16r0FFF ifTrue:[ ^ #TIBETAN ]. |
|
1953 |
asciivalue <= 16r109F ifTrue:[ ^ #MYANMAR ]. |
|
1954 |
asciivalue <= 16r10FF ifTrue:[ ^ #GEORGIAN ]. |
|
1955 |
asciivalue <= 16r11FF ifTrue:[ ^ #HANGUL_JAMO ]. |
|
1956 |
asciivalue <= 16r137F ifTrue:[ ^ #ETHIOPIC ]. |
|
1957 |
asciivalue <= 16r139F ifTrue:[ ^ #ETHIOPIC_SUPPLEMENT ]. |
|
1958 |
asciivalue <= 16r13FF ifTrue:[ ^ #CHEROKEE ]. |
|
1959 |
asciivalue <= 16r167F ifTrue:[ ^ #UNIFIED_CANADIAN_ABORIGINAL_SYLLABICS ]. |
|
1960 |
asciivalue < 16r1AB0 ifTrue:[ ^ #OTHER ]. |
|
1961 |
asciivalue <= 16r1AFF ifTrue:[ ^ #COMBINING_DIACRITICAL_MARKS_EXTENDED ]. |
|
1962 |
asciivalue < 16r1DC0 ifTrue:[ ^ #OTHER ]. |
|
1963 |
asciivalue <= 16r1DFF ifTrue:[ ^ #COMBINING_DIACRITICAL_MARKS_SUPPLEMENT ]. |
|
1964 |
asciivalue <= 16r1EFF ifTrue:[ ^ #LATIN_EXTENDED_ADDITIONAL ]. |
|
1965 |
asciivalue <= 16r1FFF ifTrue:[ ^ #GREEK_EXTENDED ]. |
|
1966 |
asciivalue <= 16r206F ifTrue:[ ^ #GENERAL_PUNKTUATION ]. |
|
1967 |
asciivalue <= 16r209F ifTrue:[ ^ #SUPERSCRIPTS_AND_SUBSCRIPTS ]. |
|
1968 |
asciivalue <= 16r20CF ifTrue:[ ^ #CURRENCY_SYMBOLS ]. |
|
1969 |
asciivalue < 16r2190 ifTrue:[ ^ #OTHER ]. |
|
1970 |
asciivalue <= 16r21FF ifTrue:[ ^ #ARROWS ]. |
|
1971 |
asciivalue <= 16r22FF ifTrue:[ ^ #MATHEMATICAL_OPERATORS ]. |
|
1972 |
asciivalue <= 16r23FF ifTrue:[ ^ #MISCELLANEOUS_TECHNICAL ]. |
|
1973 |
asciivalue < 16r2600 ifTrue:[ ^ #OTHER ]. |
|
1974 |
asciivalue <= 16r26FF ifTrue:[ ^ #MISCELLANEOUS_SYMBOLS ]. |
|
1975 |
asciivalue <= 16r27BF ifTrue:[ ^ #DINGBATS ]. |
|
1976 |
asciivalue <= 16r27EF ifTrue:[ ^ #MISCELLANEOUS_MATHEMATICAL_SYMBOLS_A ]. |
|
1977 |
^ #OTHER |
|
1978 |
||
1979 |
" |
|
1980 |
(Character value:16r200) unicodeBlock |
|
1981 |
" |
|
21374 | 1982 |
! |
1983 |
||
1984 |
utf8BytesPerCharacter |
|
1985 |
"return the number of bytes I require for storage in utf-8 encoding" |
|
1986 |
||
1987 |
asciivalue <= 16r7F ifTrue:[^ 1]. |
|
1988 |
asciivalue <= 16r7FF ifTrue:[^ 2]. |
|
1989 |
asciivalue <= 16rFFFF ifTrue:[^ 3]. |
|
1990 |
asciivalue <= 16r1FFFFF ifTrue:[^ 4]. |
|
22251 | 1991 |
asciivalue <= 16r3FFFFFF ifTrue:[^ 5]. |
1992 |
asciivalue <= 16r3FFFFFFF ifTrue:[^ 6]. |
|
1993 |
||
1994 |
self error:'character cannot represented as utf8 (too large, only 31bit supported)' |
|
21374 | 1995 |
|
1996 |
"Created: / 07-02-2017 / 14:35:56 / stefan" |
|
8004
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1997 |
! ! |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1998 |
|
1 | 1999 |
!Character methodsFor:'testing'! |
2000 |
||
54 | 2001 |
isCharacter |
2002 |
"return true, if the receiver is some kind of character" |
|
2003 |
||
2004 |
^ true |
|
2005 |
! |
|
2006 |
||
3667 | 2007 |
isControlCharacter |
8097 | 2008 |
"return true if I am a control character (i.e. ascii value < 32 or == 16rFF)" |
3667 | 2009 |
|
2010 |
%{ /* NOCONTEXT */ |
|
14684 | 2011 |
REGISTER INT val; |
3667 | 2012 |
|
2013 |
val = __intVal(__INST(asciivalue)); |
|
8097 | 2014 |
if (val < ' ' || val == 0xFF) { |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2015 |
RETURN ( true ); |
3667 | 2016 |
} |
5423
e33decc83182
non-primitive fallBack code added
Claus Gittinger <cg@exept.de>
parents:
5407
diff
changeset
|
2017 |
RETURN (false); |
3667 | 2018 |
%}. |
2019 |
||
2020 |
" |
|
2021 |
(Character value:1) isControlCharacter |
|
2022 |
$a isControlCharacter |
|
2023 |
" |
|
2024 |
! |
|
2025 |
||
1 | 2026 |
isDigit |
2027 |
"return true, if I am a digit (i.e. $0 .. $9)" |
|
2028 |
||
7980 | 2029 |
%{ /* NOCONTEXT */ |
6527 | 2030 |
|
14684 | 2031 |
REGISTER INT val; |
6527 | 2032 |
|
2033 |
val = __intVal(__INST(asciivalue)); |
|
14684 | 2034 |
if ((unsigned INT)(val - '0') <= ('9' - '0')) { |
9153 | 2035 |
RETURN ( true ); |
6527 | 2036 |
} |
2037 |
RETURN ( false ); |
|
2038 |
%}. |
|
8097 | 2039 |
^ asciivalue between:$0 codePoint and:$9 codePoint |
1 | 2040 |
! |
2041 |
||
2042 |
isDigitRadix:r |
|
2043 |
"return true, if I am a digit of a base r number" |
|
2044 |
||
9153 | 2045 |
(asciivalue < $0 codePoint) ifTrue:[^ false]. |
1 | 2046 |
(r > 10) ifTrue:[ |
9153 | 2047 |
(asciivalue <= $9 codePoint) ifTrue:[ |
2048 |
^ true |
|
2049 |
]. |
|
2050 |
((asciivalue - $a codePoint) between:0 and:(r - 11)) ifTrue:[ |
|
2051 |
^ true |
|
2052 |
]. |
|
2053 |
^ (asciivalue - $A codePoint) between:0 and:(r - 11) |
|
1 | 2054 |
]. |
8097 | 2055 |
(asciivalue - $0 codePoint) < r ifTrue:[^ true]. |
1 | 2056 |
^ false |
2057 |
! |
|
2058 |
||
699 | 2059 |
isEndOfLineCharacter |
2060 |
"return true if I am a line delimitting character" |
|
1 | 2061 |
|
2062 |
%{ /* NOCONTEXT */ |
|
2063 |
||
14684 | 2064 |
REGISTER INT val; |
1 | 2065 |
|
1133 | 2066 |
val = __intVal(__INST(asciivalue)); |
699 | 2067 |
if ((val == '\n') |
2068 |
|| (val == '\r') |
|
2069 |
|| (val == '\f')) { |
|
9153 | 2070 |
RETURN ( true ); |
54 | 2071 |
} |
5423
e33decc83182
non-primitive fallBack code added
Claus Gittinger <cg@exept.de>
parents:
5407
diff
changeset
|
2072 |
RETURN (false); |
e33decc83182
non-primitive fallBack code added
Claus Gittinger <cg@exept.de>
parents:
5407
diff
changeset
|
2073 |
%}. |
e33decc83182
non-primitive fallBack code added
Claus Gittinger <cg@exept.de>
parents:
5407
diff
changeset
|
2074 |
^ asciivalue == 16r0A |
e33decc83182
non-primitive fallBack code added
Claus Gittinger <cg@exept.de>
parents:
5407
diff
changeset
|
2075 |
or:[asciivalue == 16r0D |
e33decc83182
non-primitive fallBack code added
Claus Gittinger <cg@exept.de>
parents:
5407
diff
changeset
|
2076 |
or:[asciivalue == 16r0C]] |
e33decc83182
non-primitive fallBack code added
Claus Gittinger <cg@exept.de>
parents:
5407
diff
changeset
|
2077 |
|
1 | 2078 |
! |
2079 |
||
5473
c48d8c45c740
isImmediate returns true for shared characters
Claus Gittinger <cg@exept.de>
parents:
5471
diff
changeset
|
2080 |
isImmediate |
c48d8c45c740
isImmediate returns true for shared characters
Claus Gittinger <cg@exept.de>
parents:
5471
diff
changeset
|
2081 |
"return true if I am an immediate object |
c48d8c45c740
isImmediate returns true for shared characters
Claus Gittinger <cg@exept.de>
parents:
5471
diff
changeset
|
2082 |
i.e. I am represented in the pointer itself and |
24188 | 2083 |
no real object header/storage is used by me. |
9153 | 2084 |
For VW compatibility, shared characters (i.e. in the range 0..MAX_IMMEDIATE_CHARACTER) |
5473
c48d8c45c740
isImmediate returns true for shared characters
Claus Gittinger <cg@exept.de>
parents:
5471
diff
changeset
|
2085 |
also return true here" |
9153 | 2086 |
|
8097 | 2087 |
%{ /* NOCONTEXT */ |
2088 |
if (__smallIntegerVal(__INST(asciivalue)) <= MAX_IMMEDIATE_CHARACTER) { |
|
24188 | 2089 |
RETURN ( true ); |
8097 | 2090 |
} |
2091 |
%}. |
|
2092 |
^ false |
|
2093 |
||
2094 |
" |
|
24188 | 2095 |
$a isImmediate. |
2096 |
(Character value:255) isImmediate. |
|
2097 |
(Character value:256) isImmediate. |
|
2098 |
(Character value:1566) isImmediate. |
|
8097 | 2099 |
" |
24188 | 2100 |
|
2101 |
"Modified: / 27-05-2019 / 15:38:42 / Claus Gittinger" |
|
5473
c48d8c45c740
isImmediate returns true for shared characters
Claus Gittinger <cg@exept.de>
parents:
5471
diff
changeset
|
2102 |
! |
c48d8c45c740
isImmediate returns true for shared characters
Claus Gittinger <cg@exept.de>
parents:
5471
diff
changeset
|
2103 |
|
1 | 2104 |
isLetter |
7979
7515722ccfb1
isUppercase / isLowercase fix for division character.
Claus Gittinger <cg@exept.de>
parents:
7976
diff
changeset
|
2105 |
"return true, if I am a letter in the 'a'..'z' range. |
7515722ccfb1
isUppercase / isLowercase fix for division character.
Claus Gittinger <cg@exept.de>
parents:
7976
diff
changeset
|
2106 |
Use isNationalLetter, if you are interested in those." |
1 | 2107 |
|
7980 | 2108 |
%{ /* NOCONTEXT */ |
1 | 2109 |
|
14684 | 2110 |
REGISTER INT val; |
1 | 2111 |
|
1133 | 2112 |
val = __intVal(__INST(asciivalue)); |
14684 | 2113 |
if ((unsigned INT)(val - 'a') <= ('z' - 'a')) { |
9153 | 2114 |
RETURN ( true ); |
6527 | 2115 |
} |
14684 | 2116 |
if ((unsigned INT)(val - 'A') <= ('Z' - 'A')) { |
9153 | 2117 |
RETURN ( true ); |
6527 | 2118 |
} |
2119 |
RETURN ( false ); |
|
5423
e33decc83182
non-primitive fallBack code added
Claus Gittinger <cg@exept.de>
parents:
5407
diff
changeset
|
2120 |
%}. |
8097 | 2121 |
^ (asciivalue between:($a codePoint) and:($z codePoint)) |
2122 |
or:[(asciivalue between:($A codePoint) and:($Z codePoint))] |
|
1 | 2123 |
! |
2124 |
||
154 | 2125 |
isLetterOrDigit |
7979
7515722ccfb1
isUppercase / isLowercase fix for division character.
Claus Gittinger <cg@exept.de>
parents:
7976
diff
changeset
|
2126 |
"return true, if I am a letter (a..z or A..Z) or a digit (0..9) |
7515722ccfb1
isUppercase / isLowercase fix for division character.
Claus Gittinger <cg@exept.de>
parents:
7976
diff
changeset
|
2127 |
Use isNationalAlphaNumeric, if you are interested in those." |
1 | 2128 |
|
2129 |
%{ /* NOCONTEXT */ |
|
2130 |
||
14684 | 2131 |
REGISTER INT val; |
1 | 2132 |
|
1133 | 2133 |
val = __intVal(__INST(asciivalue)); |
14684 | 2134 |
if ((unsigned INT)(val - 'a') <= ('z' - 'a')) { |
9153 | 2135 |
RETURN ( true ); |
1 | 2136 |
} |
14684 | 2137 |
if ((unsigned INT)(val - 'A') <= ('Z' - 'A')) { |
9153 | 2138 |
RETURN ( true ); |
1 | 2139 |
} |
14684 | 2140 |
if ((unsigned INT)(val - '0') <= ('9' - '0')) { |
9153 | 2141 |
RETURN ( true ); |
1 | 2142 |
} |
2143 |
RETURN ( false ); |
|
5423
e33decc83182
non-primitive fallBack code added
Claus Gittinger <cg@exept.de>
parents:
5407
diff
changeset
|
2144 |
%}. |
e33decc83182
non-primitive fallBack code added
Claus Gittinger <cg@exept.de>
parents:
5407
diff
changeset
|
2145 |
^ self isLetter or:[self isDigit] |
1 | 2146 |
! |
2147 |
||
24143 | 2148 |
isLetterOrDigitOrUnderline |
2149 |
"return true, if I am a letter or a digit or $_" |
|
2150 |
||
2151 |
^ self == $_ or:[ self isLetterOrDigit ] |
|
2152 |
||
2153 |
"Created: / 24-05-2019 / 12:56:23 / Claus Gittinger" |
|
2154 |
! |
|
2155 |
||
17440 | 2156 |
isLetterOrUnderline |
2157 |
"return true, if I am a letter or $_" |
|
2158 |
||
2159 |
^ self == $_ or:[ self isLetter ] |
|
2160 |
! |
|
2161 |
||
699 | 2162 |
isLowercase |
7979
7515722ccfb1
isUppercase / isLowercase fix for division character.
Claus Gittinger <cg@exept.de>
parents:
7976
diff
changeset
|
2163 |
"return true, if I am a lower-case letter. |
8022
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2164 |
This one does care for national characters. |
9153 | 2165 |
Caveat: |
14684 | 2166 |
only returns the correct value for codes up to u+1d6ff (Unicode3.1). |
2167 |
(which is more than mozilla does, btw. ;-)" |
|
699 | 2168 |
|
2169 |
%{ /* NOCONTEXT */ |
|
2170 |
||
14684 | 2171 |
REGISTER unsigned INT val; |
18658
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2172 |
REGISTER unsigned int lowByte; |
7989
7907420b2fab
asUppercase / asLowercase for U0100..U04FF
Claus Gittinger <cg@exept.de>
parents:
7988
diff
changeset
|
2173 |
#define TRUE_IF_ODD(x) ((x & 1) ? true : false) |
7907420b2fab
asUppercase / asLowercase for U0100..U04FF
Claus Gittinger <cg@exept.de>
parents:
7988
diff
changeset
|
2174 |
#define TRUE_IF_EVEN(x) ((x & 1) ? false : true) |
154 | 2175 |
|
14684 | 2176 |
/* because used so often, this is open coded, instead of table driven */ |
1133 | 2177 |
val = __intVal(__INST(asciivalue)); |
18658
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2178 |
lowByte = val & 0xFF; |
14684 | 2179 |
|
2180 |
/* the most likely case here, outside the switch */ |
|
2181 |
if (val <= 0xFF) { |
|
18658
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2182 |
if ((unsigned)(lowByte - 'a') <= ('z' - 'a')) { |
14684 | 2183 |
RETURN ( true ); |
2184 |
} |
|
2185 |
||
2186 |
/* iso8859 puts national lower case characters at e0 .. ff */ |
|
18658
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2187 |
if ((lowByte >= 0xDF) && (lowByte <= 0xFF)) { |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2188 |
if (lowByte != 0xF7) { |
14684 | 2189 |
RETURN(true); |
2190 |
} |
|
2191 |
} |
|
18658
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2192 |
if (lowByte == 0xAA) RETURN(true); /* FEMININE ORDINAL INDICATOR (high a-underline) */ |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2193 |
if (lowByte == 0xB5) RETURN(true); /* MICRO SIGN */ |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2194 |
if (lowByte == 0xBA) RETURN(true); /* MASCULINE ORDINAL INDICATOR (high o-underline) */ |
14684 | 2195 |
RETURN (false); |
2196 |
} |
|
2197 |
||
7989
7907420b2fab
asUppercase / asLowercase for U0100..U04FF
Claus Gittinger <cg@exept.de>
parents:
7988
diff
changeset
|
2198 |
switch (val >> 8) { |
14684 | 2199 |
case 0x01: |
18658
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2200 |
if (lowByte <= 0x37) { RETURN (TRUE_IF_ODD(lowByte)); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2201 |
if (lowByte <= 0x48) { RETURN (TRUE_IF_EVEN(lowByte)); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2202 |
if (lowByte <= 0x78) { RETURN (TRUE_IF_ODD(lowByte)); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2203 |
if (lowByte <= 0x7E) { RETURN (TRUE_IF_EVEN(lowByte)); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2204 |
if (lowByte <= 0x80) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2205 |
if (lowByte < 0xCD) { |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2206 |
if (lowByte == 0x81) { RETURN (false); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2207 |
if (lowByte <= 0x85) { |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2208 |
RETURN (TRUE_IF_ODD(lowByte)); |
14684 | 2209 |
} |
18658
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2210 |
if (lowByte == 0x88) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2211 |
if (lowByte == 0x8C) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2212 |
if (lowByte == 0x8D) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2213 |
if (lowByte == 0x92) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2214 |
if (lowByte == 0x95) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2215 |
if (lowByte == 0x99) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2216 |
if (lowByte == 0x9A) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2217 |
if (lowByte == 0x9B) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2218 |
if (lowByte == 0x9E) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2219 |
if (lowByte <= 0xA0) { RETURN (false); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2220 |
if (lowByte <= 0xA6) { RETURN (TRUE_IF_ODD(lowByte)); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2221 |
if (lowByte <= 0xAA) { RETURN (TRUE_IF_EVEN(lowByte)); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2222 |
if (lowByte <= 0xAE) { RETURN (TRUE_IF_ODD(lowByte)); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2223 |
if (lowByte == 0xB2) { RETURN (false); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2224 |
if (lowByte <= 0xB6) { RETURN (TRUE_IF_EVEN(lowByte)); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2225 |
if (lowByte == 0xB9) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2226 |
if (lowByte == 0xBA) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2227 |
if (lowByte == 0xBD) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2228 |
if (lowByte == 0xBE) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2229 |
if (lowByte == 0xBF) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2230 |
if (lowByte == 0xC6) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2231 |
if (lowByte == 0xC9) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2232 |
if (lowByte == 0xCC) { RETURN (true); } |
14684 | 2233 |
RETURN (false); |
2234 |
} |
|
18658
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2235 |
if (lowByte <= 0xDC) { RETURN (TRUE_IF_EVEN(lowByte)); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2236 |
if (lowByte <= 0xEF) { RETURN (TRUE_IF_ODD(lowByte)); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2237 |
if (lowByte == 0xF0) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2238 |
if (lowByte == 0xF1) { RETURN (false); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2239 |
if (lowByte == 0xF2) { RETURN (false); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2240 |
if (lowByte == 0xF3) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2241 |
if (lowByte <= 0xF6) { RETURN (TRUE_IF_ODD(lowByte)); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2242 |
if (lowByte == 0xF7) { RETURN (false); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2243 |
RETURN (TRUE_IF_ODD(lowByte)); |
14684 | 2244 |
|
2245 |
case 0x02: |
|
18658
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2246 |
if (lowByte <= 0x33) { RETURN (TRUE_IF_ODD(lowByte)); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2247 |
if (lowByte <= 0x36) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2248 |
if (lowByte < 0x50) { RETURN (false); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2249 |
if (lowByte < 0xB0) { RETURN (true); } |
14684 | 2250 |
RETURN (false); |
2251 |
||
2252 |
||
2253 |
case 0x03: |
|
18658
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2254 |
if (lowByte == 0x90) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2255 |
if (lowByte <= 0xAB) { RETURN (false); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2256 |
if (lowByte <= 0xD1) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2257 |
if (lowByte == 0xD5) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2258 |
if (lowByte == 0xD6) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2259 |
if (lowByte < 0xD7) { RETURN (false); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2260 |
if (lowByte <= 0xEF) { RETURN (TRUE_IF_ODD(lowByte)); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2261 |
if (lowByte <= 0xF3) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2262 |
if (lowByte == 0xF5) { RETURN (true); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2263 |
#ifndef UNICODE_3_2 |
18658
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2264 |
if (lowByte == 0xF8) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2265 |
if (lowByte == 0xFB) { RETURN (true); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2266 |
#endif |
14684 | 2267 |
RETURN (false); |
2268 |
||
2269 |
case 0x04: |
|
18658
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2270 |
if (lowByte <= 0x2F) { RETURN (false); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2271 |
if (lowByte <= 0x5F) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2272 |
if (lowByte <= 0x81) { RETURN (TRUE_IF_ODD(lowByte)); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2273 |
if (lowByte < 0x8A) { RETURN (false); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2274 |
if (lowByte <= 0xC0) { RETURN (TRUE_IF_ODD(lowByte)); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2275 |
#ifdef UNICODE_3_2 |
18658
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2276 |
if (lowByte == 0xC5) { RETURN (true); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2277 |
#endif |
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2278 |
#ifdef UNICODE_3_2 |
18658
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2279 |
if (lowByte <= 0xC8) { RETURN (TRUE_IF_EVEN(lowByte)); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2280 |
#else |
18658
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2281 |
if (lowByte <= 0xCA) { RETURN (TRUE_IF_EVEN(lowByte)); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2282 |
if (lowByte == 0xCD) { RETURN (false); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2283 |
if (lowByte == 0xCE) { RETURN (true); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2284 |
#endif |
18658
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2285 |
if (lowByte == 0xCB) { RETURN (false); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2286 |
if (lowByte == 0xCC) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2287 |
RETURN (TRUE_IF_ODD(lowByte)); |
14684 | 2288 |
|
2289 |
case 0x05: |
|
18658
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2290 |
if (lowByte <= 0x0F) { RETURN (TRUE_IF_ODD(lowByte)); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2291 |
if (lowByte < 0x61) { RETURN (false); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2292 |
if (lowByte <= 0x87) { RETURN (true); } |
14684 | 2293 |
RETURN (false); |
2294 |
||
2295 |
case 0x1D: |
|
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2296 |
#ifndef UNICODE_3_2 |
18658
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2297 |
if (lowByte <= 0x2B) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2298 |
if (lowByte <= 0x61) { RETURN (false); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2299 |
if (lowByte <= 0x70) { RETURN (true); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2300 |
#endif |
14684 | 2301 |
RETURN (false); |
2302 |
||
2303 |
case 0x1E: |
|
18658
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2304 |
if (lowByte < 0x96) { RETURN (TRUE_IF_ODD(lowByte)); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2305 |
if (lowByte <= 0x9F) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2306 |
RETURN (TRUE_IF_ODD(lowByte)); |
14684 | 2307 |
|
2308 |
case 0x1F: |
|
18658
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2309 |
if (lowByte <= 0x6F) { |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2310 |
if (lowByte & 0x0008) { RETURN (false); } |
14684 | 2311 |
RETURN (true); |
2312 |
} |
|
18658
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2313 |
if (lowByte <= 0x87) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2314 |
if (lowByte < 0xB8) { |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2315 |
if (lowByte & 0x0008) { RETURN (false); } |
14684 | 2316 |
RETURN (true); |
2317 |
} |
|
18658
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2318 |
if (lowByte == 0xBE) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2319 |
if (lowByte == 0xD4) { RETURN (false); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2320 |
if (lowByte == 0xC5) { RETURN (false); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2321 |
if (lowByte == 0xD5) { RETURN (false); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2322 |
if (lowByte == 0xC1) { RETURN (false); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2323 |
if (lowByte == 0xF1) { RETURN (false); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2324 |
if (lowByte == 0xC0) { RETURN (false); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2325 |
if (lowByte == 0xF0) { RETURN (false); } |
22491 | 2326 |
if ((lowByte & 0x000F) <= 0x0007) { RETURN (true); } |
14684 | 2327 |
RETURN (false); |
2328 |
||
2329 |
case 0x20: |
|
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2330 |
#ifndef UNICODE_3_2 |
18658
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2331 |
if (lowByte == 0x71) { RETURN (true); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2332 |
#endif |
18658
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2333 |
if (lowByte == 0x7F) { RETURN (true); } |
14684 | 2334 |
RETURN (false); |
2335 |
||
2336 |
case 0x21: |
|
18658
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2337 |
if (lowByte == 0x0A) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2338 |
if (lowByte < 0x0E) { RETURN (false); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2339 |
if (lowByte <= 0x0F) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2340 |
if (lowByte == 0x13) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2341 |
if (lowByte == 0x2F) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2342 |
if (lowByte == 0x34) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2343 |
if (lowByte == 0x39) { RETURN (true); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2344 |
#ifndef UNICODE_3_2 |
18658
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2345 |
if (lowByte == 0x3D) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2346 |
if (lowByte <= 0x45) { RETURN (false); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2347 |
if (lowByte <= 0x49) { RETURN (true); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2348 |
#endif |
14684 | 2349 |
RETURN (false); |
2350 |
||
2351 |
case 0xFB: |
|
18658
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2352 |
if (lowByte <= 0x1C) { RETURN (true); } |
14684 | 2353 |
RETURN (false); |
2354 |
||
2355 |
case 0xFF: |
|
18658
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2356 |
if ((lowByte >= 0x41) && (lowByte <= 0x5A)) { RETURN (true); } |
14684 | 2357 |
RETURN (false); |
2358 |
||
2359 |
case 0x104: |
|
18658
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2360 |
if (lowByte <= 0x27) { RETURN (false); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2361 |
if (lowByte <= 0x4D) { RETURN (true); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2362 |
#ifdef UNICODE_3_2 |
18658
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2363 |
if (lowByte <= 0x4D) { RETURN (true); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2364 |
#else |
18658
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2365 |
if (lowByte <= 0x4F) { RETURN (true); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2366 |
#endif |
14684 | 2367 |
RETURN (false); |
2368 |
||
2369 |
case 0x1D4: |
|
2370 |
case 0x1D5: |
|
2371 |
case 0x1D6: |
|
2372 |
if (val <= 0x1D419) { RETURN (false); } |
|
2373 |
if (val < 0x1D6be) { |
|
2374 |
if (((val - 0x1D41A) % 52) <= 25) { RETURN (true); } |
|
2375 |
RETURN (false); |
|
2376 |
} |
|
2377 |
if (val < 0x1D6c2) { RETURN (false); } |
|
2378 |
if (val < 0x1D6db) { RETURN (true); } |
|
2379 |
if (val == 0x1D6db) { RETURN (false); } |
|
2380 |
if (val < 0x1D6e2) { RETURN (true); } |
|
2381 |
if (val <= 0x1D6fb) { RETURN (false); } |
|
2382 |
RETURN (true); |
|
13558 | 2383 |
|
2384 |
#ifdef UNICODE_4 |
|
14684 | 2385 |
case 0x1D7: |
18658
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2386 |
if (lowByte <= 0x1b) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2387 |
if (lowByte <= 0x35) { RETURN (false); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2388 |
if (lowByte <= 0x55) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2389 |
if (lowByte <= 0x6f) { RETURN (false); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2390 |
if (lowByte <= 0x8F) { RETURN (true); } |
14684 | 2391 |
|
2392 |
RETURN (false); |
|
13558 | 2393 |
#endif |
699 | 2394 |
} |
7989
7907420b2fab
asUppercase / asLowercase for U0100..U04FF
Claus Gittinger <cg@exept.de>
parents:
7988
diff
changeset
|
2395 |
#undef TRUE_IF_ODD |
7907420b2fab
asUppercase / asLowercase for U0100..U04FF
Claus Gittinger <cg@exept.de>
parents:
7988
diff
changeset
|
2396 |
#undef TRUE_IF_EVEN |
7907420b2fab
asUppercase / asLowercase for U0100..U04FF
Claus Gittinger <cg@exept.de>
parents:
7988
diff
changeset
|
2397 |
RETURN (false); |
5423
e33decc83182
non-primitive fallBack code added
Claus Gittinger <cg@exept.de>
parents:
5407
diff
changeset
|
2398 |
%}. |
13558 | 2399 |
|
2400 |
"Modified: / 05-08-2011 / 18:56:33 / cg" |
|
154 | 2401 |
! |
2402 |
||
699 | 2403 |
isPrintable |
2404 |
"return true, if the receiver is a useful printable character |
|
19810 | 2405 |
(see fileBrowser's showFile:-method on how it can be used)" |
1 | 2406 |
|
699 | 2407 |
(asciivalue between:32 and:127) ifTrue:[^ true]. |
6398 | 2408 |
asciivalue == 12 ifTrue:[^ true]. "/ FF |
2409 |
asciivalue == 13 ifTrue:[^ true]. "/ CR |
|
2410 |
asciivalue == 9 ifTrue:[^ true]. "/ TAB |
|
2411 |
asciivalue == 10 ifTrue:[^ true]. "/ NL |
|
2840 | 2412 |
|
8097 | 2413 |
(asciivalue between:16rA0 and:16rBF) ifTrue:[^ true]. "/ ISO-8859 |
2414 |
^ self isNationalAlphaNumeric |
|
2840 | 2415 |
|
2416 |
"Modified: 7.8.1997 / 17:05:24 / cg" |
|
1 | 2417 |
! |
2418 |
||
2419 |
isSeparator |
|
2420 |
"return true if I am a space, cr, tab, nl, or newPage" |
|
2421 |
||
2422 |
%{ /* NOCONTEXT */ |
|
2423 |
||
14684 | 2424 |
REGISTER INT val; |
1 | 2425 |
|
1133 | 2426 |
val = __intVal(__INST(asciivalue)); |
328 | 2427 |
if (val <= ' ') |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2428 |
if ((val == ' ') |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2429 |
|| (val == '\n') |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2430 |
|| (val == '\t') |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2431 |
|| (val == '\r') |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2432 |
|| (val == '\f')) { |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2433 |
RETURN ( true ); |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2434 |
} |
5423
e33decc83182
non-primitive fallBack code added
Claus Gittinger <cg@exept.de>
parents:
5407
diff
changeset
|
2435 |
RETURN (false); |
9153 | 2436 |
%}. |
5423
e33decc83182
non-primitive fallBack code added
Claus Gittinger <cg@exept.de>
parents:
5407
diff
changeset
|
2437 |
^ (asciivalue == 16r20) |
e33decc83182
non-primitive fallBack code added
Claus Gittinger <cg@exept.de>
parents:
5407
diff
changeset
|
2438 |
or:[asciivalue == 16r0D |
e33decc83182
non-primitive fallBack code added
Claus Gittinger <cg@exept.de>
parents:
5407
diff
changeset
|
2439 |
or:[asciivalue == 16r0A |
e33decc83182
non-primitive fallBack code added
Claus Gittinger <cg@exept.de>
parents:
5407
diff
changeset
|
2440 |
or:[asciivalue == 16r09 |
e33decc83182
non-primitive fallBack code added
Claus Gittinger <cg@exept.de>
parents:
5407
diff
changeset
|
2441 |
or:[asciivalue == 16r0C]]]] |
1 | 2442 |
! |
2443 |
||
699 | 2444 |
isUppercase |
7979
7515722ccfb1
isUppercase / isLowercase fix for division character.
Claus Gittinger <cg@exept.de>
parents:
7976
diff
changeset
|
2445 |
"return true, if I am an upper-case letter. |
8022
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2446 |
This one does care for national characters. |
9153 | 2447 |
Caveat: |
2448 |
only returns the correct value for codes up to u+1d6ff (Unicode3.1). |
|
2449 |
(which is more than mozilla does, btw. ;-)" |
|
1 | 2450 |
|
2451 |
%{ /* NOCONTEXT */ |
|
7988
cb1c920e67eb
isUppercase / isLowercase unicode changes
Claus Gittinger <cg@exept.de>
parents:
7987
diff
changeset
|
2452 |
#define TRUE_IF_ODD(x) ((x & 1) ? true : false) |
cb1c920e67eb
isUppercase / isLowercase unicode changes
Claus Gittinger <cg@exept.de>
parents:
7987
diff
changeset
|
2453 |
#define TRUE_IF_EVEN(x) ((x & 1) ? false : true) |
1 | 2454 |
|
14684 | 2455 |
/* because used so often, this is open coded, instead of table driven */ |
2456 |
REGISTER unsigned INT val; |
|
18658
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2457 |
REGISTER int lowByte; |
1 | 2458 |
|
1133 | 2459 |
val = __intVal(__INST(asciivalue)); |
18658
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2460 |
lowByte = val & 0xFF; |
7979
7515722ccfb1
isUppercase / isLowercase fix for division character.
Claus Gittinger <cg@exept.de>
parents:
7976
diff
changeset
|
2461 |
|
14684 | 2462 |
/* the most likely case here, outside the switch */ |
2463 |
if (val <= 0xFF) { |
|
18658
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2464 |
if ((unsigned int)(lowByte - 'A') <= ('Z' - 'A')) { |
14684 | 2465 |
RETURN ( true ); |
2466 |
} |
|
2467 |
/* iso8859 puts national upper case characters at c0 .. df */ |
|
18658
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2468 |
if ((lowByte >= 0xC0) && (lowByte <= 0xDE)) { |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2469 |
if (lowByte != 0xD7) { |
14684 | 2470 |
RETURN(true); |
2471 |
} |
|
2472 |
} |
|
2473 |
RETURN (false); |
|
2474 |
} |
|
2475 |
||
7988
cb1c920e67eb
isUppercase / isLowercase unicode changes
Claus Gittinger <cg@exept.de>
parents:
7987
diff
changeset
|
2476 |
switch (val >> 8) { |
9153 | 2477 |
case 0x01: |
18658
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2478 |
if (lowByte <= 0x37) { RETURN (TRUE_IF_EVEN(lowByte)); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2479 |
if (lowByte <= 0x48) { RETURN (TRUE_IF_ODD(lowByte)); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2480 |
if (lowByte <= 0x78) { RETURN (TRUE_IF_EVEN(lowByte)); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2481 |
if (lowByte <= 0x7E) { RETURN (TRUE_IF_ODD(lowByte)); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2482 |
if (lowByte < 0xCD) { |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2483 |
if (lowByte == 0x80) { RETURN (false); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2484 |
if (lowByte == 0x81) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2485 |
if (lowByte <= 0x86) { |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2486 |
RETURN (TRUE_IF_EVEN(lowByte)); |
9153 | 2487 |
} |
18658
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2488 |
if (lowByte <= 0x89) { |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2489 |
RETURN (TRUE_IF_ODD(lowByte)); |
9153 | 2490 |
} |
18658
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2491 |
if (lowByte <= 0x8B) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2492 |
if (lowByte <= 0x8D) { RETURN (false); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2493 |
if (lowByte <= 0x91) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2494 |
if (lowByte == 0x93) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2495 |
if (lowByte == 0x94) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2496 |
if (lowByte == 0x96) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2497 |
if (lowByte == 0x97) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2498 |
if (lowByte == 0x98) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2499 |
if (lowByte == 0x9C) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2500 |
if (lowByte == 0x9D) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2501 |
if (lowByte == 0x9F) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2502 |
if (lowByte < 0xA0) { RETURN (false); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2503 |
if (lowByte <= 0xA6) { RETURN (TRUE_IF_EVEN(lowByte)); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2504 |
if (lowByte <= 0xAA) { RETURN (TRUE_IF_ODD(lowByte)); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2505 |
if (lowByte <= 0xAE) { RETURN (TRUE_IF_EVEN(lowByte)); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2506 |
if (lowByte == 0xB2) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2507 |
if (lowByte <= 0xB7) { RETURN (TRUE_IF_ODD(lowByte)); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2508 |
if (lowByte == 0xB8) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2509 |
if (lowByte == 0xBC) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2510 |
if (lowByte == 0xC4) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2511 |
if (lowByte == 0xC7) { RETURN (true); } |
8308 | 2512 |
#if 0 |
18658
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2513 |
if (lowByte == 0xC8) { RETURN (true); } |
8308 | 2514 |
#endif |
18658
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2515 |
if (lowByte == 0xCA) { RETURN (true); } |
8308 | 2516 |
#if 0 |
18658
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2517 |
if (lowByte == 0xCB) { RETURN (true); } |
8308 | 2518 |
#endif |
9153 | 2519 |
RETURN (false); /* WRONG !!! */ |
2520 |
} |
|
18658
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2521 |
if (lowByte <= 0xDC) { RETURN (TRUE_IF_ODD(lowByte)); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2522 |
if (lowByte <= 0xEF) { RETURN (TRUE_IF_EVEN(lowByte)); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2523 |
if (lowByte == 0xF0) { RETURN (false); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2524 |
if (lowByte == 0xF1) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2525 |
if (lowByte == 0xF2) { RETURN (false); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2526 |
if (lowByte == 0xF3) { RETURN (false); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2527 |
if (lowByte == 0xF4) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2528 |
if (lowByte == 0xF5) { RETURN (false); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2529 |
if (lowByte == 0xF6) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2530 |
if (lowByte == 0xF7) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2531 |
RETURN (TRUE_IF_EVEN(lowByte)); |
9153 | 2532 |
|
2533 |
case 0x02: |
|
18658
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2534 |
if (lowByte <= 0x33) { RETURN (TRUE_IF_EVEN(lowByte)); } |
9153 | 2535 |
RETURN (false); |
2536 |
||
2537 |
case 0x03: |
|
18658
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2538 |
if (lowByte < 0x86) { RETURN (false); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2539 |
if (lowByte == 0x87) { RETURN (false); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2540 |
if (lowByte == 0x90) { RETURN (false); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2541 |
if (lowByte <= 0xAB) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2542 |
if (lowByte <= 0xD1) { RETURN (false); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2543 |
if (lowByte <= 0xD4) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2544 |
if (lowByte <= 0xD7) { RETURN (false); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2545 |
if (lowByte <= 0xEF) { RETURN (TRUE_IF_EVEN(lowByte)); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2546 |
if (lowByte == 0xF4) { RETURN (true); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2547 |
#ifndef UNICODE_3_2 |
18658
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2548 |
if (lowByte == 0xF7) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2549 |
if (lowByte == 0xF9) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2550 |
if (lowByte == 0xFa) { RETURN (true); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2551 |
#endif |
9153 | 2552 |
RETURN (false); |
2553 |
||
2554 |
case 0x04: |
|
18658
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2555 |
if (lowByte <= 0x2F) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2556 |
if (lowByte <= 0x5F) { RETURN (false); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2557 |
if (lowByte <= 0x81) { RETURN (TRUE_IF_EVEN(lowByte)); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2558 |
if (lowByte < 0x8A) { RETURN (false); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2559 |
if (lowByte <= 0xC0) { RETURN (TRUE_IF_EVEN(lowByte)); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2560 |
#ifdef UNICODE_3_2 |
18658
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2561 |
if (lowByte == 0xC5) { RETURN (false); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2562 |
#endif |
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2563 |
#ifdef UNICODE_3_2 |
18658
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2564 |
if (lowByte <= 0xC8) { RETURN (TRUE_IF_ODD(lowByte)); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2565 |
#else |
18658
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2566 |
if (lowByte <= 0xCA) { RETURN (TRUE_IF_ODD(lowByte)); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2567 |
if (lowByte == 0xCD) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2568 |
if (lowByte == 0xCE) { RETURN (false); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2569 |
#endif |
18658
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2570 |
if (lowByte == 0xCB) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2571 |
if (lowByte == 0xCC) { RETURN (false); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2572 |
RETURN (TRUE_IF_EVEN(lowByte)); |
9153 | 2573 |
|
2574 |
case 0x05: |
|
18658
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2575 |
if (lowByte <= 0x0F) { RETURN (TRUE_IF_EVEN(lowByte)); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2576 |
if (lowByte < 0x31) { RETURN (false); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2577 |
if (lowByte <= 0x56) { RETURN (true); } |
9153 | 2578 |
RETURN (false); |
2579 |
||
2580 |
case 0x10: |
|
18658
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2581 |
if (lowByte < 0xA0) { RETURN (false); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2582 |
if (lowByte <= 0xCF) { RETURN (true); } |
9153 | 2583 |
RETURN (false); |
2584 |
||
2585 |
case 0x1E: |
|
18658
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2586 |
if (lowByte < 0x96) { RETURN (TRUE_IF_EVEN(lowByte)); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2587 |
if (lowByte < 0xA0) { RETURN (false); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2588 |
RETURN (TRUE_IF_EVEN(lowByte)); |
9153 | 2589 |
|
2590 |
case 0x1F: |
|
18658
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2591 |
if (lowByte <= 0x6F) { |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2592 |
if (lowByte & 0x0008) { RETURN (true); } |
9153 | 2593 |
} |
18658
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2594 |
if (lowByte <= 0x87) { RETURN (false); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2595 |
if (lowByte < 0xB8) { RETURN (false); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2596 |
if (lowByte < 0xBC) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2597 |
if (lowByte == 0xEC) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2598 |
if (((lowByte & 0x000F) >= 0x0008) && ((lowByte & 0x000F) <= 0x000B)) { RETURN (true); } |
9153 | 2599 |
RETURN (false); |
2600 |
||
2601 |
case 0x21: |
|
18658
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2602 |
if (lowByte == 0x02) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2603 |
if (lowByte == 0x07) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2604 |
if (lowByte < 0x0B) { RETURN (false); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2605 |
if (lowByte < 0x0E) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2606 |
if (lowByte == 0x10) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2607 |
if (lowByte == 0x11) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2608 |
if (lowByte == 0x12) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2609 |
if (lowByte == 0x15) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2610 |
if (lowByte == 0x19) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2611 |
if (lowByte == 0x1A) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2612 |
if (lowByte == 0x1B) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2613 |
if (lowByte == 0x1C) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2614 |
if (lowByte == 0x1D) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2615 |
if (lowByte < 0x24) { RETURN (false); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2616 |
if (lowByte <= 0x2A) { RETURN (TRUE_IF_EVEN(lowByte)); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2617 |
if (lowByte == 0x2B) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2618 |
if (lowByte == 0x2C) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2619 |
if (lowByte == 0x2D) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2620 |
if (lowByte == 0x30) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2621 |
if (lowByte == 0x31) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2622 |
if (lowByte == 0x33) { RETURN (true); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2623 |
#ifndef UNICODE_3_2 |
18658
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2624 |
if (lowByte == 0x3E) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2625 |
if (lowByte == 0x3F) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2626 |
if (lowByte == 0x45) { RETURN (true); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2627 |
#endif |
9153 | 2628 |
RETURN (false); |
2629 |
||
2630 |
case 0xFF: |
|
18658
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2631 |
if ((lowByte >= 0x21) && (lowByte <= 0x3A)) { RETURN (true); } |
9153 | 2632 |
RETURN (false); |
2633 |
||
2634 |
case 0x104: |
|
18658
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2635 |
if (lowByte <= 0x27) { RETURN (true); } |
9153 | 2636 |
RETURN (false); |
2637 |
||
2638 |
case 0x1D4: |
|
2639 |
case 0x1D5: |
|
2640 |
case 0x1D6: |
|
2641 |
if (val <= 0x1D419) { RETURN (true); } |
|
2642 |
if (val < 0x1D6be) { |
|
2643 |
if (((val - 0x1D41A) % 52) <= 25) { RETURN (false); } |
|
2644 |
RETURN (true); |
|
2645 |
} |
|
2646 |
if (val < 0x1D6c1) { RETURN (true); } |
|
2647 |
if (val < 0x1D6e2) { RETURN (false); } |
|
2648 |
if (val < 0x1D6fb) { RETURN (true); } |
|
2649 |
||
2650 |
RETURN (false); |
|
7979
7515722ccfb1
isUppercase / isLowercase fix for division character.
Claus Gittinger <cg@exept.de>
parents:
7976
diff
changeset
|
2651 |
} |
7988
cb1c920e67eb
isUppercase / isLowercase unicode changes
Claus Gittinger <cg@exept.de>
parents:
7987
diff
changeset
|
2652 |
RETURN (false); |
7985 | 2653 |
|
9153 | 2654 |
#undef TRUE_IF_ODD |
2655 |
#undef TRUE_IF_EVEN |
|
7988
cb1c920e67eb
isUppercase / isLowercase unicode changes
Claus Gittinger <cg@exept.de>
parents:
7987
diff
changeset
|
2656 |
%} |
1 | 2657 |
! |
2658 |
||
699 | 2659 |
isVowel |
2660 |
"return true, if I am a vowel (lower- or uppercase)" |
|
333 | 2661 |
|
6066 | 2662 |
"/ I know the code is ugly; |
2663 |
"/ better code is: |
|
2664 |
"/ 'aeiou' includes:self asLowercase |
|
2665 |
"/ or: |
|
2666 |
"/ 'aeiouAEIOU' includes:self |
|
2667 |
"/ |
|
2668 |
"/ until I have a smart compiler, I use the shorter (codewise): |
|
2669 |
||
699 | 2670 |
(self == $a) ifTrue:[^ true]. |
2671 |
(self == $e) ifTrue:[^ true]. |
|
2672 |
(self == $i) ifTrue:[^ true]. |
|
2673 |
(self == $o) ifTrue:[^ true]. |
|
2674 |
(self == $u) ifTrue:[^ true]. |
|
2675 |
(self == $A) ifTrue:[^ true]. |
|
2676 |
(self == $E) ifTrue:[^ true]. |
|
2677 |
(self == $I) ifTrue:[^ true]. |
|
2678 |
(self == $O) ifTrue:[^ true]. |
|
2679 |
(self == $U) ifTrue:[^ true]. |
|
2680 |
^ false |
|
1 | 2681 |
! ! |
699 | 2682 |
|
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2683 |
!Character methodsFor:'testing - national'! |
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2684 |
|
17188 | 2685 |
asNonDiacritical |
2686 |
"return a new character which represents the receiver without diacritics. |
|
2687 |
This is used with string search and when lists are to be ordered/sorted by base character order. |
|
2688 |
CAVEAT: |
|
18215 | 2689 |
for now, this method is only correct for unicode characters up to u+2FF, |
2690 |
i.e. latin languages" |
|
17188 | 2691 |
|
2692 |
%{ /* NOCONTEXT */ |
|
2693 |
||
2694 |
REGISTER INT val; |
|
2695 |
||
2696 |
/* because used so often, this is open coded, instead of table driven */ |
|
2697 |
val = __intVal(__INST(asciivalue)); |
|
2698 |
switch (val >> 8) { |
|
18215 | 2699 |
case 0x00: |
2700 |
if (val < 0xC0) { RETURN(self); } |
|
2701 |
if (val <= 0xC6) { val = 'A'; break; } |
|
2702 |
if (val == 0xC7) { val = 'C'; break; } |
|
2703 |
if (val <= 0xCB) { val = 'E'; break; } |
|
2704 |
if (val <= 0xCF) { val = 'I'; break; } |
|
2705 |
if (val == 0xD0) { val = 'D'; break; } |
|
2706 |
if (val == 0xD1) { val = 'N'; break; } |
|
2707 |
if (val <= 0xD6) { val = 'O'; break; } |
|
2708 |
if (val == 0xD7) { RETURN(self) } |
|
2709 |
if (val == 0xD8) { val = 'O'; break; } |
|
2710 |
if (val <= 0xDC) { val = 'U'; break; } |
|
2711 |
if (val == 0xDD) { val = 'Y'; break; } |
|
2712 |
||
2713 |
if (val < 0xE0) { RETURN(self) } |
|
2714 |
if (val <= 0xE6) { val = 'a'; break; } |
|
2715 |
if (val == 0xE7) { val = 'c'; break; } |
|
2716 |
if (val <= 0xEB) { val = 'e'; break; } |
|
2717 |
if (val <= 0xEF) { val = 'i'; break; } |
|
2718 |
if (val == 0xF0) { val = 'd'; break; } |
|
2719 |
if (val == 0xF1) { val = 'n'; break; } |
|
2720 |
if (val <= 0xF6) { val = 'o'; break; } |
|
2721 |
if (val == 0xF7) { RETURN(self) } |
|
2722 |
if (val == 0xF8) { val = 'o'; break; } |
|
2723 |
if (val <= 0xFC) { val = 'u'; break; } |
|
2724 |
if (val == 0xFD) { val = 'y'; break; } |
|
2725 |
if (val == 0xFF) { val = 'y'; break; } |
|
2726 |
RETURN (self); |
|
2727 |
||
2728 |
case 0x01: |
|
2729 |
if (val <= 0x105) { val = (val & 1) ? 'a' : 'A'; break; } |
|
2730 |
if (val <= 0x10D) { val = (val & 1) ? 'c' : 'C'; break; } |
|
2731 |
if (val <= 0x111) { val = (val & 1) ? 'd' : 'D'; break; } |
|
2732 |
if (val <= 0x11B) { val = (val & 1) ? 'e' : 'E'; break; } |
|
2733 |
if (val <= 0x123) { val = (val & 1) ? 'g' : 'G'; break; } |
|
2734 |
if (val <= 0x127) { val = (val & 1) ? 'h' : 'H'; break; } |
|
2735 |
if (val <= 0x133) { val = (val & 1) ? 'i' : 'I'; break; } |
|
2736 |
if (val <= 0x137) { val = (val & 1) ? 'k' : 'K'; break; } |
|
2737 |
if (val == 0x138) { val = 'K'; break; } |
|
2738 |
if (val <= 0x142) { val = (val & 1) ? 'L' : 'l'; break; } |
|
2739 |
if (val <= 0x148) { val = (val & 1) ? 'N' : 'n'; break; } |
|
2740 |
if (val <= 0x14B) { val = (val & 1) ? 'n' : 'N'; break; } |
|
2741 |
if (val <= 0x153) { val = (val & 1) ? 'o' : 'O'; break; } |
|
2742 |
if (val <= 0x159) { val = (val & 1) ? 'r' : 'R'; break; } |
|
2743 |
if (val <= 0x161) { val = (val & 1) ? 's' : 'S'; break; } |
|
2744 |
if (val <= 0x167) { val = (val & 1) ? 't' : 'T'; break; } |
|
2745 |
if (val <= 0x173) { val = (val & 1) ? 'u' : 'U'; break; } |
|
2746 |
if (val <= 0x175) { val = (val & 1) ? 'w' : 'W'; break; } |
|
2747 |
if (val <= 0x178) { val = (val & 1) ? 'y' : 'Y'; break; } |
|
2748 |
if (val <= 0x17E) { val = (val & 1) ? 'Z' : 'z'; break; } |
|
2749 |
RETURN (self); |
|
2750 |
||
2751 |
case 0x02: |
|
2752 |
if (val <= 0x203) { val = (val & 1) ? 'a' : 'A'; break; } |
|
2753 |
if (val <= 0x207) { val = (val & 1) ? 'e' : 'E'; break; } |
|
2754 |
if (val <= 0x20B) { val = (val & 1) ? 'i' : 'I'; break; } |
|
2755 |
if (val <= 0x20F) { val = (val & 1) ? 'o' : 'O'; break; } |
|
2756 |
if (val <= 0x213) { val = (val & 1) ? 'r' : 'R'; break; } |
|
2757 |
if (val <= 0x217) { val = (val & 1) ? 'u' : 'U'; break; } |
|
2758 |
if (val <= 0x219) { val = (val & 1) ? 's' : 'S'; break; } |
|
2759 |
if (val <= 0x21B) { val = (val & 1) ? 't' : 'T'; break; } |
|
2760 |
RETURN (self); |
|
2761 |
||
2762 |
case 0x03: |
|
2763 |
// to be done |
|
2764 |
RETURN (self); |
|
2765 |
||
2766 |
case 0x04: |
|
2767 |
// to be done |
|
2768 |
RETURN (self); |
|
17188 | 2769 |
} |
2770 |
if (val <= MAX_IMMEDIATE_CHARACTER) { |
|
18215 | 2771 |
RETURN (__MKCHARACTER(val)) ; |
17188 | 2772 |
} |
2773 |
RETURN (__MKUCHARACTER(val)) ; |
|
2774 |
%} |
|
2775 |
||
2776 |
" |
|
2777 |
$e asNonDiacritical |
|
23950 | 2778 |
$é asNonDiacritical |
2779 |
$ä asNonDiacritical |
|
2780 |
$Ã¥ asNonDiacritical |
|
17188 | 2781 |
" |
2782 |
! |
|
2783 |
||
24296 | 2784 |
isGreekLetter |
2785 |
"return true, if the receiver is a greek letter (alpha, beta,...)." |
|
2786 |
||
2787 |
%{ /* NOCONTEXT */ |
|
2788 |
||
2789 |
REGISTER INT val; |
|
2790 |
||
2791 |
/* open coded, instead of table driven */ |
|
2792 |
val = __intVal(__INST(asciivalue)); |
|
2793 |
if ((val >= 0x0391) && (val <= 0x3A9)) { |
|
2794 |
RETURN(true); // UC greek |
|
2795 |
} |
|
2796 |
if ((val >= 0x03B1) && (val <= 0x3C9)) { |
|
2797 |
RETURN(true); // LC greek |
|
2798 |
} |
|
2799 |
RETURN (false); |
|
2800 |
%} |
|
2801 |
||
2802 |
" |
|
2803 |
$a isGreekLetter |
|
2804 |
$Ï€ isGreekLetter -- pi |
|
2805 |
$Ω isGreekLetter -- omega |
|
2806 |
" |
|
2807 |
||
2808 |
"Created: / 08-06-2019 / 14:49:56 / Claus Gittinger" |
|
2809 |
! |
|
2810 |
||
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2811 |
isNationalAlphaNumeric |
18268 | 2812 |
"return true, if the receiver is a letter or digit. |
2813 |
This assumes unicode encoding." |
|
2814 |
||
2815 |
^ self isNationalLetter or:[self isNationalDigit] |
|
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2816 |
! |
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2817 |
|
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2818 |
isNationalDigit |
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2819 |
"return true, if the receiver is a digit. |
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2820 |
This assumes unicode encoding. |
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2821 |
WARNING: this method is not complete." |
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2822 |
|
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2823 |
|codePoint "{ Class SmallInteger }"| |
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2824 |
|
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2825 |
codePoint := asciivalue. |
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2826 |
|
9153 | 2827 |
codePoint <= 16rFF ifTrue:[ "/ u00xx - unicode latin1 page |
18298 | 2828 |
^ codePoint between:$0 codePoint and:$9 codePoint. |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2829 |
]. |
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2830 |
|
18268 | 2831 |
^ codePoint between:16rFF10 and:16rFF19 |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2832 |
! |
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2833 |
|
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2834 |
isNationalLetter |
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2835 |
"return true, if the receiver is a letter. |
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2836 |
CAVEAT: |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2837 |
for now, this method is only correct for unicode characters up to u+1d6ff (Unicode3.1). |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2838 |
(which is more than mozilla does, btw. ;-)" |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2839 |
|
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2840 |
%{ /* NOCONTEXT */ |
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2841 |
|
14684 | 2842 |
REGISTER INT val; |
2843 |
||
2844 |
/* because used so often, this is open coded, instead of table driven */ |
|
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2845 |
val = __intVal(__INST(asciivalue)); |
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2846 |
switch (val >> 8) { |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2847 |
case 0x00: |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2848 |
if ((unsigned INT)(val - 'A') <= ('Z' - 'A')) { |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2849 |
RETURN ( true ); |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2850 |
} |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2851 |
if ((unsigned INT)(val - 'a') <= ('z' - 'a')) { |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2852 |
RETURN ( true ); |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2853 |
} |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2854 |
if (val == 0xAA) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2855 |
if (val == 0xB5) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2856 |
if (val == 0xBA) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2857 |
if (val < 0xC0) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2858 |
if (val == 0xD7) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2859 |
if (val == 0xF7) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2860 |
RETURN (true); |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2861 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2862 |
case 0x01: |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2863 |
RETURN (true); |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2864 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2865 |
case 0x02: |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2866 |
#ifdef UNICODE_3_2 |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2867 |
if (val <= 0x2B8) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2868 |
if (val == 0x2B9) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2869 |
if (val == 0x2BA) { RETURN (false); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2870 |
#else |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2871 |
if (val <= 0x2BA) { RETURN (true); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2872 |
#endif |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2873 |
if (val <= 0x2C1) { RETURN (true); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2874 |
#ifndef UNICODE_3_2 |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2875 |
if (val <= 0x2C5) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2876 |
if (val <= 0x2CF) { RETURN (true); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2877 |
#endif |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2878 |
if (val == 0x2D0) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2879 |
if (val == 0x2D1) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2880 |
if (val <= 0x2DF) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2881 |
if (val <= 0x2E4) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2882 |
if (val == 0x2EE) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2883 |
RETURN (false); |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2884 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2885 |
case 0x03: |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2886 |
if (val == 0x37A) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2887 |
if (val <= 0x385) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2888 |
if (val == 0x387) { RETURN (false); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2889 |
#ifndef UNICODE_3_2 |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2890 |
if (val == 0x3F6) { RETURN (false); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2891 |
#endif |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2892 |
RETURN (true); |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2893 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2894 |
case 0x04: |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2895 |
if (val <= 0x481) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2896 |
if (val <= 0x486) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2897 |
if (val == 0x487) { RETURN (true); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2898 |
#ifdef UNICODE_3_2 |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2899 |
if (val <= 0x48A) { RETURN (false); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2900 |
#else |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2901 |
if (val <= 0x489) { RETURN (false); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2902 |
#endif |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2903 |
RETURN (true); |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2904 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2905 |
case 0x05: |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2906 |
if (val <= 0x50f) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2907 |
if (val <= 0x530) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2908 |
if (val <= 0x556) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2909 |
if (val <= 0x558) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2910 |
if (val <= 0x559) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2911 |
if (val <= 0x55F) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2912 |
if (val <= 0x587) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2913 |
if (val <= 0x5cf) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2914 |
if (val <= 0x5f2) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2915 |
RETURN (false); |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2916 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2917 |
case 0x06: |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2918 |
if (val <= 0x620) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2919 |
if (val <= 0x64A) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2920 |
if (val <= 0x66D) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2921 |
if (val == 0x670) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2922 |
if (val <= 0x6D3) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2923 |
if (val == 0x6D5) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2924 |
if (val == 0x6E5) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2925 |
if (val == 0x6E6) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2926 |
if (val == 0x6EE) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2927 |
if (val == 0x6EF) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2928 |
if (val == 0x6FA) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2929 |
if (val == 0x6FB) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2930 |
if (val == 0x6FC) { RETURN (true); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2931 |
#ifndef UNICODE_3_2 |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2932 |
if (val == 0x6FF) { RETURN (true); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2933 |
#endif |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2934 |
RETURN (false); |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2935 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2936 |
case 0x07: |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2937 |
if (val <= 0x70F) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2938 |
if (val == 0x711) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2939 |
if (val <= 0x72F) { RETURN (true); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2940 |
#ifdef UNICODE_3_2 |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2941 |
if (val <= 0x74d) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2942 |
if (val <= 0x74e) { RETURN (true); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2943 |
#else |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2944 |
if (val <= 0x74c) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2945 |
if (val <= 0x74f) { RETURN (true); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2946 |
#endif |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2947 |
if (val <= 0x77F) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2948 |
if (val <= 0x7a5) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2949 |
if (val <= 0x7af) { RETURN (false); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2950 |
#ifndef UNICODE_3_2 |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2951 |
if (val == 0x7B1) { RETURN (true); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2952 |
#endif |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2953 |
RETURN (false); |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2954 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2955 |
case 0x09: |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2956 |
#ifdef UNICODE_3_2 |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2957 |
if (val <= 0x904) { RETURN (false); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2958 |
#else |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2959 |
if (val <= 0x903) { RETURN (false); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2960 |
#endif |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2961 |
if (val <= 0x93B) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2962 |
if (val == 0x93D) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2963 |
if (val == 0x950) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2964 |
if (val <= 0x957) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2965 |
if (val <= 0x961) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2966 |
if (val <= 0x984) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2967 |
if (val <= 0x9BB) { RETURN (true); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2968 |
#ifndef UNICODE_3_2 |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2969 |
if (val == 0x9BD) { RETURN (true); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2970 |
#endif |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2971 |
if (val <= 0x9DB) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2972 |
if (val <= 0x9E1) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2973 |
if (val <= 0x9EF) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2974 |
if (val <= 0x9F1) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2975 |
RETURN (false); |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2976 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2977 |
case 0x0A: |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2978 |
if (val <= 0xa04) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2979 |
if (val <= 0xa3B) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2980 |
if (val <= 0xa58) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2981 |
if (val <= 0xa65) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2982 |
if (val <= 0xa71) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2983 |
if (val <= 0xa80) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2984 |
if (val <= 0xa84) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2985 |
if (val <= 0xaBB) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2986 |
if (val == 0xaBD) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2987 |
if (val <= 0xaCF) { RETURN (false); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2988 |
#ifndef UNICODE_3_2 |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2989 |
if (val == 0xAE2) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2990 |
if (val == 0xAE3) { RETURN (false); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2991 |
#endif |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2992 |
if (val <= 0xaE5) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2993 |
RETURN (false); |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2994 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2995 |
case 0x0B: |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2996 |
if (val <= 0xB04) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2997 |
if (val <= 0xb3B) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2998 |
if (val == 0xb3d) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2999 |
if (val <= 0xb5B) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3000 |
if (val <= 0xb65) { RETURN (true); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
3001 |
#ifndef UNICODE_3_2 |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3002 |
if (val == 0xB71) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3003 |
if (val == 0xB83) { RETURN (true); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
3004 |
#endif |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3005 |
if (val <= 0xb84) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3006 |
if (val <= 0xbBB) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3007 |
RETURN (false); |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3008 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3009 |
case 0x0c: |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3010 |
if (val <= 0xc04) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3011 |
if (val <= 0xc3d) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3012 |
if (val <= 0xc5f) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3013 |
if (val <= 0xc65) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3014 |
if (val <= 0xc84) { RETURN (false); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
3015 |
#ifndef UNICODE_3_2 |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3016 |
if (val == 0xcbc) { RETURN (false); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
3017 |
#endif |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3018 |
if (val <= 0xcbd) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3019 |
if (val <= 0xcdc) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3020 |
if (val <= 0xce5) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3021 |
RETURN (false); |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3022 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3023 |
case 0x0d: |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3024 |
if (val <= 0xd04) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3025 |
if (val <= 0xd3d) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3026 |
if (val <= 0xd5f) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3027 |
if (val <= 0xd65) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3028 |
if (val <= 0xd84) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3029 |
if (val <= 0xdc9) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3030 |
RETURN (false); |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3031 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3032 |
case 0x0E: |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3033 |
if (val == 0xE31) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3034 |
if (val <= 0xE33) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3035 |
if (val <= 0xE3F) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3036 |
if (val <= 0xE46) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3037 |
if (val <= 0xE7f) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3038 |
if (val <= 0xEb0) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3039 |
if (val == 0xEb1) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3040 |
if (val <= 0xEb3) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3041 |
if (val <= 0xEbc) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3042 |
if (val <= 0xEc7) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3043 |
if (val <= 0xEdb) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3044 |
RETURN (true); |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3045 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3046 |
case 0x0F: |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3047 |
if (val == 0xf00) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3048 |
if (val <= 0xf3F) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3049 |
if (val <= 0xf70) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3050 |
if (val <= 0xf87) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3051 |
if (val <= 0xf8f) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3052 |
RETURN (false); |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3053 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3054 |
case 0x10: |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3055 |
if (val <= 0x102b) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3056 |
if (val <= 0x104f) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3057 |
if (val <= 0x1055) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3058 |
if (val <= 0x109f) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3059 |
if (val <= 0x10fa) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3060 |
RETURN (false); |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3061 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3062 |
case 0x11: |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3063 |
case 0x12: |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3064 |
RETURN (true); |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3065 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3066 |
case 0x13: |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3067 |
if (val <= 0x1360) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3068 |
if (val <= 0x139f) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3069 |
RETURN (true); |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3070 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3071 |
case 0x14: |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3072 |
case 0x15: |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3073 |
RETURN (true); |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3074 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3075 |
case 0x16: |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3076 |
if (val == 0x166d) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3077 |
if (val == 0x166e) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3078 |
if (val == 0x1680) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3079 |
if (val == 0x169b) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3080 |
if (val == 0x169c) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3081 |
if (val <= 0x16ea) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3082 |
RETURN (false); |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3083 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3084 |
case 0x17: |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
3085 |
#ifndef UNICODE_3_2 |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3086 |
if (val == 0x1712) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3087 |
if (val == 0x1713) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3088 |
if (val == 0x1714) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3089 |
if (val == 0x1732) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3090 |
if (val == 0x1733) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3091 |
if (val == 0x1734) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3092 |
if (val == 0x1735) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3093 |
if (val == 0x1736) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3094 |
if (val == 0x1752) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3095 |
if (val == 0x1753) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3096 |
if (val == 0x1772) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3097 |
if (val == 0x1773) { RETURN (false); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
3098 |
#endif |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3099 |
if (val <= 0x17b3) { RETURN (true); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
3100 |
#ifndef UNICODE_3_2 |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3101 |
if (val == 0x17D7) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3102 |
if (val == 0x17DC) { RETURN (true); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
3103 |
#endif |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3104 |
RETURN (false); |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3105 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3106 |
case 0x18: |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3107 |
if (val <= 0x181f) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3108 |
if (val <= 0x18a8) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3109 |
RETURN (false); |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3110 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3111 |
case 0x19: |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
3112 |
#ifndef UNICODE_3_2 |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3113 |
if (val <= 0x191F) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3114 |
if (val <= 0x194F) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3115 |
if (val <= 0x197F) { RETURN (true); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
3116 |
#endif |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3117 |
RETURN (false); |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3118 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3119 |
case 0x1d: |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3120 |
if (val <= 0x1d6B) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3121 |
RETURN (false); |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3122 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3123 |
case 0x1e: |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3124 |
RETURN (true); |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3125 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3126 |
case 0x1f: |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3127 |
if (val <= 0x1fbc) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3128 |
if (val == 0x1fbe) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3129 |
if (val <= 0x1fc1) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3130 |
if (val <= 0x1fcc) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3131 |
if (val <= 0x1fcf) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3132 |
if (val <= 0x1fdc) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3133 |
if (val <= 0x1fdf) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3134 |
if (val <= 0x1fec) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3135 |
if (val <= 0x1ff1) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3136 |
if (val <= 0x1ffc) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3137 |
RETURN (false); |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3138 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3139 |
case 0x20: |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
3140 |
#ifndef UNICODE_3_2 |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3141 |
if (val == 0x2071) { RETURN (true); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
3142 |
#endif |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3143 |
if (val == 0x207f) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3144 |
RETURN (false); |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3145 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3146 |
case 0x21: |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3147 |
if (val == 0x2102) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3148 |
if (val == 0x2107) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3149 |
if (val <= 0x2109) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3150 |
if (val <= 0x2113) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3151 |
if (val == 0x2115) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3152 |
if (val <= 0x2118) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3153 |
if (val <= 0x211d) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3154 |
if (val <= 0x2123) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3155 |
if (val == 0x2125) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3156 |
if (val == 0x2127) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3157 |
if (val == 0x2129) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3158 |
if (val == 0x212E) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3159 |
if (val == 0x2132) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3160 |
if (val == 0x213A) { RETURN (false); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
3161 |
#ifndef UNICODE_3_2 |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3162 |
if (val == 0x213B) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3163 |
if (val <= 0x213F) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3164 |
if (val <= 0x2144) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3165 |
if (val == 0x214A) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3166 |
if (val == 0x214B) { RETURN (false); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
3167 |
#endif |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3168 |
if (val <= 0x2152) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3169 |
RETURN (false); |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3170 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3171 |
case 0x30: |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3172 |
if (val == 0x3005) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3173 |
if (val == 0x3006) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3174 |
if (val <= 0x3030) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3175 |
if (val <= 0x3035) { RETURN (true); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
3176 |
#ifndef UNICODE_3_2 |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3177 |
if (val == 0x303B) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3178 |
if (val == 0x303C) { RETURN (true); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
3179 |
#endif |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3180 |
if (val <= 0x3040) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3181 |
if (val <= 0x3098) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3182 |
if (val <= 0x309c) { RETURN (false); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
3183 |
#ifndef UNICODE_3_2 |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3184 |
if (val == 0x30A0) { RETURN (false); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
3185 |
#endif |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3186 |
if (val == 0x30Fb) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3187 |
RETURN ((true)); |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3188 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3189 |
case 0x31: |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3190 |
if (val <= 0x318f) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3191 |
if (val <= 0x319F) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3192 |
RETURN ((true)); |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3193 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3194 |
case 0x34: |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3195 |
RETURN ((true)); |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3196 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3197 |
case 0x4d: |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3198 |
if (val <= 0x4DB4) { RETURN (false); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
3199 |
#ifndef UNICODE_3_2 |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3200 |
if (val <= 0x4DBF) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3201 |
RETURN (false); |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
3202 |
#else |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3203 |
RETURN (true); |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
3204 |
#endif |
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
3205 |
|
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3206 |
case 0x4e: |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3207 |
RETURN ((true)); |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3208 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3209 |
case 0x9f: |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3210 |
if (val <= 0x9fa4) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3211 |
RETURN (true); |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3212 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3213 |
case 0xA0: |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3214 |
case 0xA1: |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3215 |
case 0xA2: |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3216 |
case 0xA3: |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3217 |
RETURN (true); |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3218 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3219 |
case 0xA4: |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3220 |
if (val <= 0xa48f) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3221 |
RETURN (false); |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3222 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3223 |
case 0xA5: |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3224 |
RETURN (true); |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3225 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3226 |
case 0xAC: |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3227 |
RETURN (true); |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3228 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3229 |
case 0xD7: |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3230 |
RETURN (true); |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3231 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3232 |
case 0xF9: |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3233 |
case 0xFA: |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3234 |
RETURN (true); |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3235 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3236 |
case 0xFB: |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3237 |
if (val == 0xfb1e) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3238 |
if (val == 0xfb29) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3239 |
RETURN (true); |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3240 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3241 |
case 0xFC: |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3242 |
RETURN (true); |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3243 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3244 |
case 0xFD: |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3245 |
if (val <= 0xFD3d) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3246 |
if (val <= 0xFD4F) { RETURN (false); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
3247 |
#ifndef UNICODE_3_2 |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3248 |
if (val == 0xFDFC) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3249 |
if (val == 0xFDFD) { RETURN (false); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
3250 |
#endif |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3251 |
RETURN (true); |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3252 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3253 |
case 0xFE: |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
3254 |
#ifndef UNICODE_3_2 |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3255 |
if (val <= 0xFE0F) { RETURN (false); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
3256 |
#endif |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3257 |
if (val <= 0xFE1f) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3258 |
if (val <= 0xFE6F) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3259 |
if (val <= 0xFEFE) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3260 |
RETURN (false); |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3261 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3262 |
case 0xFF: |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3263 |
if (val <= 0xFF20) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3264 |
if (val <= 0xFF3a) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3265 |
if (val <= 0xFF40) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3266 |
if (val <= 0xFF5a) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3267 |
if (val <= 0xFF65) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3268 |
if (val <= 0xFFdC) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3269 |
RETURN (false); |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3270 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3271 |
case 0x100: |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
3272 |
#ifndef UNICODE_3_2 |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3273 |
RETURN (true); |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
3274 |
#else |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3275 |
RETURN (false); |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
3276 |
#endif |
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
3277 |
|
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3278 |
case 0x103: |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3279 |
if (val <= 0x1031f) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3280 |
if (val <= 0x1032F) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3281 |
if (val <= 0x10349) { RETURN (true); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
3282 |
#ifndef UNICODE_3_2 |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3283 |
if (val <= 0x1037F) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3284 |
if (val <= 0x1039E) { RETURN (true); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
3285 |
#endif |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3286 |
RETURN (false); |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3287 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3288 |
case 0x104: |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
3289 |
#ifndef UNICODE_3_2 |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3290 |
if (val <= 0x1049F) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3291 |
if (val <= 0x104aF) { RETURN (false); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
3292 |
#endif |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3293 |
RETURN (true); |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3294 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3295 |
case 0x108: |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
3296 |
#ifndef UNICODE_3_2 |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3297 |
RETURN (true); |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
3298 |
#else |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3299 |
RETURN (false); |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
3300 |
#endif |
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
3301 |
|
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3302 |
case 0x1D4: |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3303 |
case 0x1D5: |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3304 |
RETURN (true); |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3305 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3306 |
case 0x1D6: |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3307 |
if (val == 0x1d6c1) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3308 |
if (val == 0x1d6db) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3309 |
if (val == 0x1d6fb) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3310 |
RETURN (true); |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
3311 |
} |
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
3312 |
RETURN (false); |
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
3313 |
%} |
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
3314 |
! ! |
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
3315 |
|
4655
b9405ca0bb4e
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4340
diff
changeset
|
3316 |
!Character methodsFor:'tracing'! |
b9405ca0bb4e
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4340
diff
changeset
|
3317 |
|
4682 | 3318 |
traceInto:aRequestor level:level from:referrer |
4655
b9405ca0bb4e
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4340
diff
changeset
|
3319 |
"double dispatch into tracer, passing my type implicitely in the selector" |
b9405ca0bb4e
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4340
diff
changeset
|
3320 |
|
4682 | 3321 |
^ aRequestor traceCharacter:self level:level from:referrer |
4655
b9405ca0bb4e
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4340
diff
changeset
|
3322 |
|
b9405ca0bb4e
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4340
diff
changeset
|
3323 |
! ! |
b9405ca0bb4e
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4340
diff
changeset
|
3324 |
|
8394
da194de43766
Generalize visitor pattern and define #visit...:with: -methods instead
Stefan Vogel <sv@exept.de>
parents:
8308
diff
changeset
|
3325 |
!Character methodsFor:'visiting'! |
da194de43766
Generalize visitor pattern and define #visit...:with: -methods instead
Stefan Vogel <sv@exept.de>
parents:
8308
diff
changeset
|
3326 |
|
da194de43766
Generalize visitor pattern and define #visit...:with: -methods instead
Stefan Vogel <sv@exept.de>
parents:
8308
diff
changeset
|
3327 |
acceptVisitor:aVisitor with:aParameter |
16727 | 3328 |
"dispatch for visitor pattern; send #visitCharacter:with: to aVisitor" |
8394
da194de43766
Generalize visitor pattern and define #visit...:with: -methods instead
Stefan Vogel <sv@exept.de>
parents:
8308
diff
changeset
|
3329 |
|
da194de43766
Generalize visitor pattern and define #visit...:with: -methods instead
Stefan Vogel <sv@exept.de>
parents:
8308
diff
changeset
|
3330 |
^ aVisitor visitCharacter:self with:aParameter |
da194de43766
Generalize visitor pattern and define #visit...:with: -methods instead
Stefan Vogel <sv@exept.de>
parents:
8308
diff
changeset
|
3331 |
! ! |
da194de43766
Generalize visitor pattern and define #visit...:with: -methods instead
Stefan Vogel <sv@exept.de>
parents:
8308
diff
changeset
|
3332 |
|
2124 | 3333 |
!Character class methodsFor:'documentation'! |
699 | 3334 |
|
3335 |
version |
|
18588 | 3336 |
^ '$Header$' |
14120
fdf215af772c
added: #displayOn: (instead of #displaySting)
Stefan Vogel <sv@exept.de>
parents:
14117
diff
changeset
|
3337 |
! |
fdf215af772c
added: #displayOn: (instead of #displaySting)
Stefan Vogel <sv@exept.de>
parents:
14117
diff
changeset
|
3338 |
|
fdf215af772c
added: #displayOn: (instead of #displaySting)
Stefan Vogel <sv@exept.de>
parents:
14117
diff
changeset
|
3339 |
version_CVS |
18588 | 3340 |
^ '$Header$' |
699 | 3341 |
! ! |
21374 | 3342 |