author | Claus Gittinger <cg@exept.de> |
Mon, 01 Mar 2004 22:36:04 +0100 | |
changeset 8029 | 36f28a78c76d |
parent 8028 | 4fecc8242a64 |
child 8030 | 5a4323d0280f |
permissions | -rw-r--r-- |
1 | 1 |
" |
5 | 2 |
COPYRIGHT (c) 1988 by Claus Gittinger |
154 | 3 |
All Rights Reserved |
1 | 4 |
|
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
12 |
||
5407 | 13 |
"{ Package: 'stx:libbasic' }" |
14 |
||
1 | 15 |
Magnitude subclass:#Character |
995
b018368b3a94
asString to 16-bit char should return a twoByteString
Claus Gittinger <cg@exept.de>
parents:
819
diff
changeset
|
16 |
instanceVariableNames:'asciivalue' |
b018368b3a94
asString to 16-bit char should return a twoByteString
Claus Gittinger <cg@exept.de>
parents:
819
diff
changeset
|
17 |
classVariableNames:'CharacterTable' |
b018368b3a94
asString to 16-bit char should return a twoByteString
Claus Gittinger <cg@exept.de>
parents:
819
diff
changeset
|
18 |
poolDictionaries:'' |
b018368b3a94
asString to 16-bit char should return a twoByteString
Claus Gittinger <cg@exept.de>
parents:
819
diff
changeset
|
19 |
category:'Magnitude-General' |
1 | 20 |
! |
21 |
||
2124 | 22 |
!Character class methodsFor:'documentation'! |
54 | 23 |
|
88 | 24 |
copyright |
25 |
" |
|
26 |
COPYRIGHT (c) 1988 by Claus Gittinger |
|
154 | 27 |
All Rights Reserved |
88 | 28 |
|
29 |
This software is furnished under a license and may be used |
|
30 |
only in accordance with the terms of that license and with the |
|
31 |
inclusion of the above copyright notice. This software may not |
|
32 |
be provided or otherwise made available to, or used by, any |
|
33 |
other person. No title to or ownership of the software is |
|
34 |
hereby transferred. |
|
35 |
" |
|
36 |
! |
|
37 |
||
54 | 38 |
documentation |
39 |
" |
|
1491
a42ae3fbb756
fixed asLowercase / asUppercase for national characters
Claus Gittinger <cg@exept.de>
parents:
1295
diff
changeset
|
40 |
This class represents characters. |
7897 | 41 |
|
1491
a42ae3fbb756
fixed asLowercase / asUppercase for national characters
Claus Gittinger <cg@exept.de>
parents:
1295
diff
changeset
|
42 |
Notice, that actual character objects are not used when characters |
8011 | 43 |
are stored in strings, symbols etc; |
8028 | 44 |
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
|
45 |
The word 'asciiValue' is a historic leftover - actually, any integer |
8028 | 46 |
code is allowed and actually used (i.e. characters are not limited to 8bit). |
47 |
||
48 |
Single byte Characters are unique; i.e. for every asciiValue (0..255) there exists exactly |
|
49 |
one instance of Character, which is shared |
|
50 |
(Character value:xxx checks for this, and returns a reference to an existing instance). |
|
8011 | 51 |
Other characters (i.e. asciivalue > 255) are not guaranteed to be shared; |
8028 | 52 |
i.e. these might be created as required (actually, do NOT depend on which characters are and |
53 |
which are not shared; always compare using #= if there is any chance of a non-ascii character |
|
54 |
being involved. |
|
55 |
||
1229 | 56 |
This means: you may compare characters using #== ONLY IFF you are certain, |
8028 | 57 |
that the characters ranges is 0..255. |
58 |
Otherwise, you HAVE TO compare using #=. (if in doubt, always compare using #=). |
|
1491
a42ae3fbb756
fixed asLowercase / asUppercase for national characters
Claus Gittinger <cg@exept.de>
parents:
1295
diff
changeset
|
59 |
Sorry for this inconvenience, but it is (practically) impossible to keep |
8028 | 60 |
the possible maximum of 2^32 characters (Unicode) around, for that convenience alone. |
1491
a42ae3fbb756
fixed asLowercase / asUppercase for national characters
Claus Gittinger <cg@exept.de>
parents:
1295
diff
changeset
|
61 |
|
357 | 62 |
|
68 | 63 |
Methods marked as (JS) come from the manchester Character goody |
64 |
(CharacterComparing) by Jan Steinman, which allow Characters to be used as |
|
1229 | 65 |
Interval elements (i.e. ($a to:$z) do:[...] ); |
66 |
They are not a big deal, but convenient add-ons. |
|
67 |
Some of these have been modified a bit. |
|
1 | 68 |
|
68 | 69 |
WARNING: characters are known by compiler and runtime system - |
7897 | 70 |
do not change the instance layout. |
357 | 71 |
|
72 |
Also, although you can create subclasses of Character, the compiler always |
|
73 |
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
|
74 |
... and other classes are hard-wired to always return instances of characters |
357 | 75 |
in some cases (i.e. String>>at:, Symbol>>at: etc.). |
76 |
Therefore, it may not make sense to create a character-subclass. |
|
1295 | 77 |
|
8028 | 78 |
Case Mapping in Unicode: |
79 |
There are a number of complications to case mappings that occur once the repertoire |
|
80 |
of characters is expanded beyond ASCII. |
|
81 |
||
82 |
* Because of the inclusion of certain composite characters for compatibility, |
|
83 |
such as U+01F1 'DZ' capital dz, there is a third case, called titlecase, |
|
84 |
which is used where the first letter of a word is to be capitalized |
|
85 |
(e.g. Titlecase, vs. UPPERCASE, or lowercase). |
|
86 |
For example, the title case of the example character is U+01F2 'Dz' capital d with small z. |
|
87 |
||
88 |
* Case mappings may produce strings of different length than the original. |
|
89 |
For example, the German character U+00DF small letter sharp s expands when uppercased to |
|
90 |
the sequence of two characters 'SS'. |
|
91 |
This also occurs where there is no precomposed character corresponding to a case mapping. |
|
92 |
*** This is not yet implemented (in 5.2) *** |
|
93 |
||
94 |
* Characters may also have different case mappings, depending on the context. |
|
95 |
For example, U+03A3 capital sigma lowercases to U+03C3 small sigma if it is not followed |
|
96 |
by another letter, but lowercases to 03C2 small final sigma if it is. |
|
97 |
*** This is not yet implemented (in 5.2) *** |
|
98 |
||
99 |
* Characters may have case mappings that depend on the locale. |
|
100 |
For example, in Turkish the letter 0049 'I' capital letter i lowercases to 0131 small dotless i. |
|
101 |
*** This is not yet implemented (in 5.2) *** |
|
102 |
||
103 |
* Case mappings are not, in general, reversible. |
|
104 |
For example, once the string 'McGowan' has been uppercased, lowercased or titlecased, |
|
105 |
the original cannot be recovered by applying another uppercase, lowercase, or titlecase operation. |
|
106 |
||
107 |
Collation Sequence: |
|
108 |
*** This is not yet implemented (in 5.2) *** |
|
109 |
||
1295 | 110 |
[author:] |
7897 | 111 |
Claus Gittinger |
1295 | 112 |
|
113 |
[see also:] |
|
8029 | 114 |
String TwoByteString Unicode16String Unicode32String |
7897 | 115 |
StringCollection |
54 | 116 |
" |
117 |
! ! |
|
1 | 118 |
|
2124 | 119 |
!Character class methodsFor:'instance creation'! |
1 | 120 |
|
121 |
basicNew |
|
122 |
"catch new - Characters cannot be created with new" |
|
123 |
||
124 |
^ self error:'Characters cannot be created with new' |
|
125 |
! |
|
126 |
||
699 | 127 |
digitValue:anInteger |
128 |
"return a character that corresponds to anInteger. |
|
129 |
0-9 map to $0-$9, 10-35 map to $A-$Z" |
|
130 |
||
131 |
|val "{ Class: SmallInteger }" | |
|
132 |
||
133 |
val := anInteger. |
|
134 |
(val between:0 and:9) ifTrue:[ |
|
135 |
^ Character value:(val + ($0 asciiValue)) |
|
136 |
]. |
|
137 |
(val between:10 and:35) ifTrue:[ |
|
138 |
^ Character value:(val + ($A asciiValue - 10)) |
|
139 |
]. |
|
140 |
^self error:'value not in range 0 to 35' |
|
141 |
! |
|
142 |
||
6808 | 143 |
utf8DecodeFrom:aStream |
144 |
"read and return a single unicode character from an UTF8 encoded stream" |
|
145 |
||
146 |
|fetchNext c1 c2 c3 c4 c5 ascii| |
|
147 |
||
148 |
c1 := aStream next. |
|
149 |
ascii := c1 asciiValue. |
|
150 |
ascii <= 16r7F ifTrue:[ |
|
151 |
"/ 0xxxxxxx - 7 bits |
|
152 |
^ c1. |
|
153 |
]. |
|
154 |
||
155 |
(ascii bitAnd:2r11000000) == 2r10000000 ifTrue:[ |
|
156 |
"/ out of sync (got an intermediate character) |
|
157 |
self error:'out of sync'. |
|
158 |
^ c1. |
|
159 |
]. |
|
160 |
||
161 |
fetchNext := [ |ch| |
|
162 |
||
163 |
ch := aStream next. |
|
164 |
(ch asciiValue bitAnd:2r11000000) == 2r10000000 ifFalse:[ |
|
165 |
"/ followup chars must have 2r10 in high bits |
|
166 |
self error:'bad encoding'. |
|
167 |
]. |
|
168 |
ch |
|
169 |
]. |
|
170 |
||
171 |
(ascii bitAnd:2r11100000) == 2r11000000 ifTrue:[ |
|
172 |
"/ 110xxxxx 10xxxxxx - 11 bits |
|
173 |
c2 := fetchNext value. |
|
174 |
ascii := c1 asciiValue bitAnd:16r1F. |
|
175 |
ascii := (ascii bitShift:6) bitOr:(c2 asciiValue bitAnd:16r3F). |
|
6811
2fec3f732ac6
catch invalid utf8 encodings
Claus Gittinger <cg@exept.de>
parents:
6808
diff
changeset
|
176 |
ascii <= 16r7F ifTrue:[ |
2fec3f732ac6
catch invalid utf8 encodings
Claus Gittinger <cg@exept.de>
parents:
6808
diff
changeset
|
177 |
self error:'invalid encoding'. |
2fec3f732ac6
catch invalid utf8 encodings
Claus Gittinger <cg@exept.de>
parents:
6808
diff
changeset
|
178 |
]. |
6808 | 179 |
^ Character value:ascii |
180 |
]. |
|
181 |
(ascii bitAnd:2r11110000) == 2r11100000 ifTrue:[ |
|
182 |
"/ 1110xxxx 10xxxxxx 10xxxxxx - 16 bits |
|
183 |
c2 := fetchNext value. |
|
184 |
c3 := fetchNext value. |
|
185 |
ascii := c1 asciiValue bitAnd:16r0F. |
|
186 |
ascii := (ascii bitShift:6) bitOr:(c2 asciiValue bitAnd:16r3F). |
|
187 |
ascii := (ascii bitShift:6) bitOr:(c3 asciiValue bitAnd:16r3F). |
|
6811
2fec3f732ac6
catch invalid utf8 encodings
Claus Gittinger <cg@exept.de>
parents:
6808
diff
changeset
|
188 |
ascii <= 16r7FF ifTrue:[ |
2fec3f732ac6
catch invalid utf8 encodings
Claus Gittinger <cg@exept.de>
parents:
6808
diff
changeset
|
189 |
self error:'invalid encoding'. |
2fec3f732ac6
catch invalid utf8 encodings
Claus Gittinger <cg@exept.de>
parents:
6808
diff
changeset
|
190 |
]. |
6808 | 191 |
^ Character value:ascii |
192 |
]. |
|
193 |
||
194 |
"/ notice: currently, characters can only have 16bit encoding; |
|
195 |
"/ therefore the following will raise a runtime exception, |
|
196 |
||
197 |
(ascii bitAnd:2r11111000) == 2r11110000 ifTrue:[ |
|
198 |
"/ 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx - 21 bits |
|
199 |
c2 := fetchNext value. |
|
200 |
c3 := fetchNext value. |
|
201 |
c4 := fetchNext value. |
|
202 |
ascii := c1 asciiValue bitAnd:16r07. |
|
203 |
ascii := (ascii bitShift:6) bitOr:(c2 asciiValue bitAnd:16r3F). |
|
204 |
ascii := (ascii bitShift:6) bitOr:(c3 asciiValue bitAnd:16r3F). |
|
205 |
ascii := (ascii bitShift:6) bitOr:(c4 asciiValue bitAnd:16r3F). |
|
6811
2fec3f732ac6
catch invalid utf8 encodings
Claus Gittinger <cg@exept.de>
parents:
6808
diff
changeset
|
206 |
ascii <= 16rFFFF ifTrue:[ |
2fec3f732ac6
catch invalid utf8 encodings
Claus Gittinger <cg@exept.de>
parents:
6808
diff
changeset
|
207 |
self error:'invalid encoding'. |
2fec3f732ac6
catch invalid utf8 encodings
Claus Gittinger <cg@exept.de>
parents:
6808
diff
changeset
|
208 |
]. |
6808 | 209 |
^ Character value:ascii |
210 |
]. |
|
211 |
||
212 |
(ascii bitAnd:2r11111100) == 2r11111000 ifTrue:[ |
|
213 |
"/ 111110xx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx - 26 bits |
|
214 |
c2 := fetchNext value. |
|
215 |
c3 := fetchNext value. |
|
216 |
c4 := fetchNext value. |
|
217 |
c5 := fetchNext value. |
|
218 |
ascii := c1 asciiValue bitAnd:16r03. |
|
219 |
ascii := (ascii bitShift:6) bitOr:(c2 asciiValue bitAnd:16r3F). |
|
220 |
ascii := (ascii bitShift:6) bitOr:(c3 asciiValue bitAnd:16r3F). |
|
221 |
ascii := (ascii bitShift:6) bitOr:(c4 asciiValue bitAnd:16r3F). |
|
222 |
ascii := (ascii bitShift:6) bitOr:(c5 asciiValue bitAnd:16r3F). |
|
6811
2fec3f732ac6
catch invalid utf8 encodings
Claus Gittinger <cg@exept.de>
parents:
6808
diff
changeset
|
223 |
ascii <= 16r1FFFFF ifTrue:[ |
2fec3f732ac6
catch invalid utf8 encodings
Claus Gittinger <cg@exept.de>
parents:
6808
diff
changeset
|
224 |
self error:'invalid encoding'. |
2fec3f732ac6
catch invalid utf8 encodings
Claus Gittinger <cg@exept.de>
parents:
6808
diff
changeset
|
225 |
]. |
6808 | 226 |
^ Character value:ascii |
227 |
]. |
|
228 |
||
229 |
(ascii bitAnd:2r11111110) == 2r11111100 ifTrue:[ |
|
230 |
"/ 1111110x ... 10xxxxxx - any number of bits |
|
231 |
ascii := c1 asciiValue bitAnd:16r01. |
|
232 |
||
233 |
c2 := aStream peek. |
|
234 |
[ (c2 asciiValue bitAnd:2r11000000) == 2r10000000 ] whileTrue:[ |
|
235 |
ascii := (ascii bitShift:6) bitOr:(c2 asciiValue bitAnd:16r3F). |
|
236 |
aStream next. |
|
237 |
]. |
|
6811
2fec3f732ac6
catch invalid utf8 encodings
Claus Gittinger <cg@exept.de>
parents:
6808
diff
changeset
|
238 |
ascii <= 16r3FFFFFF ifTrue:[ |
2fec3f732ac6
catch invalid utf8 encodings
Claus Gittinger <cg@exept.de>
parents:
6808
diff
changeset
|
239 |
self error:'invalid encoding'. |
2fec3f732ac6
catch invalid utf8 encodings
Claus Gittinger <cg@exept.de>
parents:
6808
diff
changeset
|
240 |
]. |
6808 | 241 |
^ Character value:ascii |
242 |
]. |
|
243 |
||
244 |
self error:'bad encoding'. |
|
245 |
^ c1 |
|
246 |
||
247 |
" |
|
248 |
Character utf8DecodeFrom:'a' readStream |
|
249 |
Character utf8DecodeFrom:#[195 188] asString readStream |
|
250 |
" |
|
251 |
||
252 |
"test: |
|
253 |
||
254 |
|utf8Encoding original readBack| |
|
255 |
||
256 |
1 to:16rFFFF do:[:ascii | |
|
257 |
original := Character value:ascii. |
|
258 |
utf8Encoding := original asString utf8Encoded. |
|
259 |
readBack := Character utf8DecodeFrom:(utf8Encoding readStream). |
|
260 |
readBack asciiValue = ascii ifFalse:[ |
|
261 |
self halt |
|
262 |
] |
|
263 |
] |
|
264 |
" |
|
265 |
! |
|
266 |
||
1 | 267 |
value:anInteger |
268 |
"return a character with asciivalue anInteger" |
|
269 |
||
270 |
%{ /* NOCONTEXT */ |
|
271 |
||
54 | 272 |
INT ascii; |
1 | 273 |
|
249 | 274 |
if (__isSmallInteger(anInteger)) { |
7951 | 275 |
ascii = __intVal(anInteger); |
7997
96b6c06b9fe9
use MAX_IMMEDIATE_CHARACTER define
Claus Gittinger <cg@exept.de>
parents:
7990
diff
changeset
|
276 |
if ((unsigned)(ascii) <= MAX_IMMEDIATE_CHARACTER /* (ascii >= 0) && (ascii <= 255) */) { |
7951 | 277 |
RETURN ( __MKCHARACTER(ascii) ); |
7997
96b6c06b9fe9
use MAX_IMMEDIATE_CHARACTER define
Claus Gittinger <cg@exept.de>
parents:
7990
diff
changeset
|
278 |
} |
1 | 279 |
} |
819 | 280 |
%}. |
7997
96b6c06b9fe9
use MAX_IMMEDIATE_CHARACTER define
Claus Gittinger <cg@exept.de>
parents:
7990
diff
changeset
|
281 |
(anInteger between:0 and:(CharacterTable size - 1)) ifTrue:[ |
7951 | 282 |
^ CharacterTable at:(anInteger + 1) |
1 | 283 |
]. |
7951 | 284 |
(anInteger between:16r100 and:16r3FFFFFFF) ifTrue:[ |
285 |
^ super basicNew setAsciiValue:anInteger |
|
1 | 286 |
]. |
357 | 287 |
" |
7951 | 288 |
a characters ascii-code must be 0..16r3FFFFFFF. |
289 |
(i.e. only characters with up-to 30 bits are allowed.) |
|
357 | 290 |
" |
1 | 291 |
self error:'invalid ascii code for character' |
699 | 292 |
! ! |
293 |
||
7300 | 294 |
!Character class methodsFor:'Compatibility-ANSI'! |
5945 | 295 |
|
296 |
codePoint:asciiValue |
|
297 |
^ self value:asciiValue |
|
298 |
! ! |
|
299 |
||
2214 | 300 |
!Character class methodsFor:'accessing untypeable characters'! |
301 |
||
302 |
endOfInput |
|
303 |
"Answer the Character representing ctrl-d ." |
|
304 |
||
305 |
^self value: 4 |
|
306 |
! |
|
307 |
||
308 |
leftParenthesis |
|
309 |
"Answer the Character representing a left parenthesis." |
|
310 |
||
311 |
^self value: 40 |
|
312 |
! |
|
313 |
||
314 |
period |
|
315 |
"Answer the Character representing a carriage period." |
|
316 |
||
317 |
^self value: 46 |
|
318 |
! |
|
319 |
||
320 |
poundSign |
|
321 |
"Answer the Character representing a pound sign." |
|
322 |
||
323 |
^self value: 35 |
|
324 |
! |
|
325 |
||
326 |
rightParenthesis |
|
327 |
"Answer the Character representing a right parenthesis." |
|
328 |
||
329 |
^self value: 41 |
|
330 |
! ! |
|
331 |
||
2124 | 332 |
!Character class methodsFor:'constants'! |
699 | 333 |
|
334 |
backspace |
|
335 |
"return the backspace character" |
|
336 |
||
337 |
^ Character value:8 |
|
338 |
! |
|
339 |
||
340 |
bell |
|
341 |
"return the bell character" |
|
342 |
||
343 |
^ Character value:7 |
|
344 |
! |
|
345 |
||
346 |
cr |
|
347 |
"return the lineEnd character |
|
348 |
- actually (in unix) this is a newline character" |
|
349 |
||
350 |
^ Character value:10 |
|
351 |
! |
|
352 |
||
353 |
del |
|
354 |
"return the delete character" |
|
355 |
||
356 |
^ Character value:16r7F |
|
357 |
! |
|
358 |
||
359 |
doubleQuote |
|
360 |
"return the double-quote character" |
|
361 |
||
362 |
^ Character value:34 |
|
363 |
! |
|
364 |
||
365 |
esc |
|
366 |
"return the escape character" |
|
367 |
||
368 |
^ Character value:27 |
|
369 |
! |
|
370 |
||
7688 | 371 |
euro |
7689 | 372 |
"The Euro currency sign (notice: not all fonts support it). |
373 |
Thats the ascii-character code; the Unicode encoding is 0x8364" |
|
7688 | 374 |
|
7976 | 375 |
^ Character value: 16r20AC |
7689 | 376 |
|
377 |
" |
|
7976 | 378 |
Transcript showCR:Character euro asString |
379 |
" |
|
380 |
" |
|
7689 | 381 |
0 to:255 do:[:i | |
382 |
Transcript |
|
383 |
show:'| '; show:((i printStringRadix:16) leftPaddedTo:2); |
|
384 |
show:' | '; show:(i printStringPaddedTo:3); |
|
385 |
show:' | '; show:(Character value:i); |
|
386 |
cr. |
|
387 |
] |
|
388 |
" |
|
7688 | 389 |
! |
390 |
||
699 | 391 |
excla |
392 |
"return the exclamation-mark character" |
|
393 |
^ $!! |
|
1 | 394 |
! |
395 |
||
699 | 396 |
ff |
397 |
"return the form-feed character" |
|
398 |
||
399 |
^ Character value:12 |
|
400 |
! |
|
401 |
||
402 |
lf |
|
403 |
"return the newline/linefeed character" |
|
404 |
||
405 |
^ Character value:10 |
|
406 |
! |
|
1 | 407 |
|
4340
523ef8410fad
added #linefeed - squeak compatibility
Claus Gittinger <cg@exept.de>
parents:
4337
diff
changeset
|
408 |
linefeed |
523ef8410fad
added #linefeed - squeak compatibility
Claus Gittinger <cg@exept.de>
parents:
4337
diff
changeset
|
409 |
"squeak compatibility: return the newline/linefeed character" |
523ef8410fad
added #linefeed - squeak compatibility
Claus Gittinger <cg@exept.de>
parents:
4337
diff
changeset
|
410 |
|
523ef8410fad
added #linefeed - squeak compatibility
Claus Gittinger <cg@exept.de>
parents:
4337
diff
changeset
|
411 |
^ Character value:10 |
523ef8410fad
added #linefeed - squeak compatibility
Claus Gittinger <cg@exept.de>
parents:
4337
diff
changeset
|
412 |
! |
523ef8410fad
added #linefeed - squeak compatibility
Claus Gittinger <cg@exept.de>
parents:
4337
diff
changeset
|
413 |
|
699 | 414 |
maxValue |
415 |
"return the maximum asciiValue a character can have" |
|
416 |
||
417 |
^ 16rFFFF |
|
418 |
! |
|
419 |
||
420 |
newPage |
|
421 |
"return the form-feed character" |
|
422 |
||
423 |
^ Character value:12 |
|
424 |
! |
|
425 |
||
426 |
nl |
|
427 |
"return the newline character" |
|
68 | 428 |
|
699 | 429 |
^ Character value:10 |
430 |
! |
|
431 |
||
6324 | 432 |
null |
433 |
^ Character value:0 |
|
434 |
! |
|
435 |
||
699 | 436 |
quote |
437 |
"return the single-quote character" |
|
438 |
||
439 |
^ Character value:39 |
|
440 |
! |
|
441 |
||
442 |
return |
|
443 |
"return the return character. |
|
444 |
In ST/X, this is different from cr - for Unix reasons." |
|
445 |
||
446 |
^ Character value:13 |
|
447 |
! |
|
448 |
||
449 |
space |
|
450 |
"return the blank character" |
|
451 |
||
452 |
^ Character value:32 |
|
453 |
! |
|
454 |
||
455 |
tab |
|
456 |
"return the tabulator character" |
|
457 |
||
458 |
^ Character value:9 |
|
1 | 459 |
! ! |
460 |
||
2124 | 461 |
!Character class methodsFor:'primitive input'! |
1 | 462 |
|
463 |
fromUser |
|
357 | 464 |
"return a character from the keyboard (C's standard input stream) |
1 | 465 |
- this should only be used for emergency evaluators and the like." |
466 |
||
467 |
%{ /* NOCONTEXT */ |
|
468 |
int c; |
|
469 |
||
470 |
c = getchar(); |
|
471 |
if (c < 0) { |
|
5433 | 472 |
RETURN (nil); |
1 | 473 |
} |
1133 | 474 |
RETURN ( __MKCHARACTER(c & 0xFF) ); |
5433 | 475 |
%}. |
476 |
^ Stdin next |
|
1 | 477 |
! ! |
478 |
||
2124 | 479 |
!Character class methodsFor:'queries'! |
3 | 480 |
|
4337
07fad5b7af9b
added #allCharacters & #separators for Squeak compatibility
Claus Gittinger <cg@exept.de>
parents:
4037
diff
changeset
|
481 |
allCharacters |
07fad5b7af9b
added #allCharacters & #separators for Squeak compatibility
Claus Gittinger <cg@exept.de>
parents:
4037
diff
changeset
|
482 |
"added for squeak compatibility: return a collection of all chars" |
07fad5b7af9b
added #allCharacters & #separators for Squeak compatibility
Claus Gittinger <cg@exept.de>
parents:
4037
diff
changeset
|
483 |
|
07fad5b7af9b
added #allCharacters & #separators for Squeak compatibility
Claus Gittinger <cg@exept.de>
parents:
4037
diff
changeset
|
484 |
^ CharacterTable |
07fad5b7af9b
added #allCharacters & #separators for Squeak compatibility
Claus Gittinger <cg@exept.de>
parents:
4037
diff
changeset
|
485 |
|
07fad5b7af9b
added #allCharacters & #separators for Squeak compatibility
Claus Gittinger <cg@exept.de>
parents:
4037
diff
changeset
|
486 |
" |
07fad5b7af9b
added #allCharacters & #separators for Squeak compatibility
Claus Gittinger <cg@exept.de>
parents:
4037
diff
changeset
|
487 |
Character allCharacters |
07fad5b7af9b
added #allCharacters & #separators for Squeak compatibility
Claus Gittinger <cg@exept.de>
parents:
4037
diff
changeset
|
488 |
" |
07fad5b7af9b
added #allCharacters & #separators for Squeak compatibility
Claus Gittinger <cg@exept.de>
parents:
4037
diff
changeset
|
489 |
! |
07fad5b7af9b
added #allCharacters & #separators for Squeak compatibility
Claus Gittinger <cg@exept.de>
parents:
4037
diff
changeset
|
490 |
|
4655
b9405ca0bb4e
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4340
diff
changeset
|
491 |
hasSharedInstances |
b9405ca0bb4e
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4340
diff
changeset
|
492 |
"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
|
493 |
with the same value are identical. |
b9405ca0bb4e
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4340
diff
changeset
|
494 |
False is returned here, only redefined in classes which have unified |
b9405ca0bb4e
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4340
diff
changeset
|
495 |
instances (or should be treated so)." |
2672
dc3662188b2c
added #hasImmediateInstances for VW compatibility
Claus Gittinger <cg@exept.de>
parents:
2561
diff
changeset
|
496 |
|
4655
b9405ca0bb4e
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4340
diff
changeset
|
497 |
^ true |
2672
dc3662188b2c
added #hasImmediateInstances for VW compatibility
Claus Gittinger <cg@exept.de>
parents:
2561
diff
changeset
|
498 |
|
4655
b9405ca0bb4e
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4340
diff
changeset
|
499 |
|
2672
dc3662188b2c
added #hasImmediateInstances for VW compatibility
Claus Gittinger <cg@exept.de>
parents:
2561
diff
changeset
|
500 |
! |
dc3662188b2c
added #hasImmediateInstances for VW compatibility
Claus Gittinger <cg@exept.de>
parents:
2561
diff
changeset
|
501 |
|
3 | 502 |
isBuiltInClass |
1271 | 503 |
"return true if this class is known by the run-time-system. |
504 |
Here, true is returned for myself, false for subclasses." |
|
3 | 505 |
|
506 |
^ self == Character |
|
1271 | 507 |
|
508 |
"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
|
509 |
! |
07fad5b7af9b
added #allCharacters & #separators for Squeak compatibility
Claus Gittinger <cg@exept.de>
parents:
4037
diff
changeset
|
510 |
|
07fad5b7af9b
added #allCharacters & #separators for Squeak compatibility
Claus Gittinger <cg@exept.de>
parents:
4037
diff
changeset
|
511 |
separators |
07fad5b7af9b
added #allCharacters & #separators for Squeak compatibility
Claus Gittinger <cg@exept.de>
parents:
4037
diff
changeset
|
512 |
"added for squeak compatibility: return a collection of separator chars" |
07fad5b7af9b
added #allCharacters & #separators for Squeak compatibility
Claus Gittinger <cg@exept.de>
parents:
4037
diff
changeset
|
513 |
|
07fad5b7af9b
added #allCharacters & #separators for Squeak compatibility
Claus Gittinger <cg@exept.de>
parents:
4037
diff
changeset
|
514 |
^ Array |
7019 | 515 |
with:Character space |
516 |
with:Character return |
|
517 |
"/ with:Character cr |
|
518 |
with:Character tab |
|
519 |
with:Character lf |
|
520 |
with:Character ff |
|
4337
07fad5b7af9b
added #allCharacters & #separators for Squeak compatibility
Claus Gittinger <cg@exept.de>
parents:
4037
diff
changeset
|
521 |
|
07fad5b7af9b
added #allCharacters & #separators for Squeak compatibility
Claus Gittinger <cg@exept.de>
parents:
4037
diff
changeset
|
522 |
" |
07fad5b7af9b
added #allCharacters & #separators for Squeak compatibility
Claus Gittinger <cg@exept.de>
parents:
4037
diff
changeset
|
523 |
Character separators |
07fad5b7af9b
added #allCharacters & #separators for Squeak compatibility
Claus Gittinger <cg@exept.de>
parents:
4037
diff
changeset
|
524 |
" |
3 | 525 |
! ! |
526 |
||
7261 | 527 |
!Character methodsFor:'Compatibility-ANSI'! |
5945 | 528 |
|
529 |
codePoint |
|
7897 | 530 |
"return the codePoint of myself. |
531 |
Traditionally, this was named 'asciiValue'; |
|
532 |
however, characters are not limited to 8bit characters." |
|
533 |
||
534 |
^ asciivalue |
|
5945 | 535 |
! ! |
5847 | 536 |
|
7261 | 537 |
!Character methodsFor:'Compatibility-Dolphin'! |
6324 | 538 |
|
7351
1f805a32d551
comments in isAlphaNumeric and isAlphabetic
Claus Gittinger <cg@exept.de>
parents:
7300
diff
changeset
|
539 |
isAlphaNumeric |
1f805a32d551
comments in isAlphaNumeric and isAlphabetic
Claus Gittinger <cg@exept.de>
parents:
7300
diff
changeset
|
540 |
"return true, if I am a letter or a digit |
1f805a32d551
comments in isAlphaNumeric and isAlphabetic
Claus Gittinger <cg@exept.de>
parents:
7300
diff
changeset
|
541 |
Please use isLetterOrDigit for compatibility reasons (which is ANSI)." |
1f805a32d551
comments in isAlphaNumeric and isAlphabetic
Claus Gittinger <cg@exept.de>
parents:
7300
diff
changeset
|
542 |
|
1f805a32d551
comments in isAlphaNumeric and isAlphabetic
Claus Gittinger <cg@exept.de>
parents:
7300
diff
changeset
|
543 |
^ self isLetterOrDigit |
1f805a32d551
comments in isAlphaNumeric and isAlphabetic
Claus Gittinger <cg@exept.de>
parents:
7300
diff
changeset
|
544 |
! |
1f805a32d551
comments in isAlphaNumeric and isAlphabetic
Claus Gittinger <cg@exept.de>
parents:
7300
diff
changeset
|
545 |
|
1f805a32d551
comments in isAlphaNumeric and isAlphabetic
Claus Gittinger <cg@exept.de>
parents:
7300
diff
changeset
|
546 |
isAlphabetic |
1f805a32d551
comments in isAlphaNumeric and isAlphabetic
Claus Gittinger <cg@exept.de>
parents:
7300
diff
changeset
|
547 |
"return true, if I am a letter. |
1f805a32d551
comments in isAlphaNumeric and isAlphabetic
Claus Gittinger <cg@exept.de>
parents:
7300
diff
changeset
|
548 |
Please use isLetter for compatibility reasons (which is ANSI)." |
1f805a32d551
comments in isAlphaNumeric and isAlphabetic
Claus Gittinger <cg@exept.de>
parents:
7300
diff
changeset
|
549 |
|
1f805a32d551
comments in isAlphaNumeric and isAlphabetic
Claus Gittinger <cg@exept.de>
parents:
7300
diff
changeset
|
550 |
^ self isLetter |
1f805a32d551
comments in isAlphaNumeric and isAlphabetic
Claus Gittinger <cg@exept.de>
parents:
7300
diff
changeset
|
551 |
! |
1f805a32d551
comments in isAlphaNumeric and isAlphabetic
Claus Gittinger <cg@exept.de>
parents:
7300
diff
changeset
|
552 |
|
6324 | 553 |
isControl |
7353 | 554 |
"return true if I am a control character (i.e. ascii value < 32)" |
555 |
||
556 |
^ self isControlCharacter |
|
6324 | 557 |
! |
558 |
||
559 |
isHexDigit |
|
7354 | 560 |
"return true if I am a valid hexadecimal digit" |
561 |
||
6324 | 562 |
^ '0123456789abcdefABCDEF' includes:self |
7354 | 563 |
|
564 |
" |
|
565 |
$a isHexDigit |
|
566 |
" |
|
6324 | 567 |
! |
568 |
||
569 |
isPunctuation |
|
7897 | 570 |
"the code below is not unicode aware" |
571 |
||
6327 | 572 |
^ (asciivalue between:16r21 and:16r40) |
573 |
or:[ (asciivalue between:16r5B and:16r60) |
|
574 |
or:[ (asciivalue between:123 and:126) |
|
575 |
or:[ (asciivalue between:161 and:191) |
|
576 |
or:[ (asciivalue == 215 ) |
|
577 |
or:[ (asciivalue == 247 ) ]]]]] |
|
6324 | 578 |
! ! |
579 |
||
1 | 580 |
!Character methodsFor:'accessing'! |
581 |
||
582 |
asciiValue |
|
54 | 583 |
"return the asciivalue of myself. |
7897 | 584 |
The name 'asciiValue' is a historic leftover: |
585 |
characters are not limited to 8bit characters. |
|
586 |
So the actual value returned is a codePoint (i.e. full potential for 31bit encoding). |
|
587 |
PP has removed this method with 4.1 and providing asInteger instead." |
|
1 | 588 |
|
7897 | 589 |
^ asciivalue |
1491
a42ae3fbb756
fixed asLowercase / asUppercase for national characters
Claus Gittinger <cg@exept.de>
parents:
1295
diff
changeset
|
590 |
|
a42ae3fbb756
fixed asLowercase / asUppercase for national characters
Claus Gittinger <cg@exept.de>
parents:
1295
diff
changeset
|
591 |
"Modified: 27.6.1996 / 12:34:34 / cg" |
1 | 592 |
! |
593 |
||
594 |
instVarAt:index put:anObject |
|
54 | 595 |
"catch instvar access - asciivalue may not be changed" |
1 | 596 |
|
597 |
self error:'Characters may not be modified' |
|
2214 | 598 |
! |
599 |
||
600 |
newDigitValue |
|
601 |
"Answer 0-9 if the receiver is $0-$9, 10-35 if it is $A-$Z, and < 0 otherwise. |
|
602 |
This is used to parse literal numbers of radix 2-36." |
|
603 |
||
604 |
| code value | |
|
605 |
code := self asInteger. |
|
606 |
value := code - $0 asInteger. |
|
607 |
value <= 9 ifTrue: [^value]. |
|
608 |
value := code - $A asInteger. |
|
609 |
(value >= 0 and: [value < 26]) |
|
610 |
ifTrue: [^value + 10]. |
|
611 |
^-1 |
|
1 | 612 |
! ! |
613 |
||
699 | 614 |
!Character methodsFor:'arithmetic'! |
1 | 615 |
|
616 |
+ aMagnitude |
|
617 |
"Return the Character that is <aMagnitude> higher than the receiver. |
|
618 |
Wrap if the resulting value is not a legal Character value. (JS)" |
|
619 |
||
6531
8798c9a1d1e6
arithmetic wraps at 16bit bounds (unicode)
Claus Gittinger <cg@exept.de>
parents:
6527
diff
changeset
|
620 |
^ Character value:(asciivalue + aMagnitude asInteger \\ 16rFFFF) |
1491
a42ae3fbb756
fixed asLowercase / asUppercase for national characters
Claus Gittinger <cg@exept.de>
parents:
1295
diff
changeset
|
621 |
|
a42ae3fbb756
fixed asLowercase / asUppercase for national characters
Claus Gittinger <cg@exept.de>
parents:
1295
diff
changeset
|
622 |
" |
a42ae3fbb756
fixed asLowercase / asUppercase for national characters
Claus Gittinger <cg@exept.de>
parents:
1295
diff
changeset
|
623 |
$A + 5 |
a42ae3fbb756
fixed asLowercase / asUppercase for national characters
Claus Gittinger <cg@exept.de>
parents:
1295
diff
changeset
|
624 |
" |
a42ae3fbb756
fixed asLowercase / asUppercase for national characters
Claus Gittinger <cg@exept.de>
parents:
1295
diff
changeset
|
625 |
|
a42ae3fbb756
fixed asLowercase / asUppercase for national characters
Claus Gittinger <cg@exept.de>
parents:
1295
diff
changeset
|
626 |
"Modified: 27.6.1996 / 12:34:51 / cg" |
1 | 627 |
! |
628 |
||
629 |
- aMagnitude |
|
630 |
"Return the Character that is <aMagnitude> lower than the receiver. |
|
68 | 631 |
Wrap if the resulting value is not a legal Character value. (JS) |
1491
a42ae3fbb756
fixed asLowercase / asUppercase for national characters
Claus Gittinger <cg@exept.de>
parents:
1295
diff
changeset
|
632 |
claus: |
6531
8798c9a1d1e6
arithmetic wraps at 16bit bounds (unicode)
Claus Gittinger <cg@exept.de>
parents:
6527
diff
changeset
|
633 |
modified to return the difference as integer, if the argument |
8798c9a1d1e6
arithmetic wraps at 16bit bounds (unicode)
Claus Gittinger <cg@exept.de>
parents:
6527
diff
changeset
|
634 |
is another character. If the argument is a number, a character is |
8798c9a1d1e6
arithmetic wraps at 16bit bounds (unicode)
Claus Gittinger <cg@exept.de>
parents:
6527
diff
changeset
|
635 |
returned." |
1 | 636 |
|
68 | 637 |
aMagnitude isCharacter ifTrue:[ |
6531
8798c9a1d1e6
arithmetic wraps at 16bit bounds (unicode)
Claus Gittinger <cg@exept.de>
parents:
6527
diff
changeset
|
638 |
^ self asciiValue - aMagnitude asciiValue |
68 | 639 |
]. |
6531
8798c9a1d1e6
arithmetic wraps at 16bit bounds (unicode)
Claus Gittinger <cg@exept.de>
parents:
6527
diff
changeset
|
640 |
^ Character value:(asciivalue - aMagnitude asInteger \\ 16rFFFF) |
68 | 641 |
|
642 |
" |
|
643 |
$z - $a |
|
644 |
$d - 3 |
|
645 |
" |
|
1491
a42ae3fbb756
fixed asLowercase / asUppercase for national characters
Claus Gittinger <cg@exept.de>
parents:
1295
diff
changeset
|
646 |
|
a42ae3fbb756
fixed asLowercase / asUppercase for national characters
Claus Gittinger <cg@exept.de>
parents:
1295
diff
changeset
|
647 |
"Modified: 27.6.1996 / 12:35:34 / cg" |
1 | 648 |
! |
649 |
||
650 |
// aMagnitude |
|
651 |
"Return the Character who's value is the receiver divided by <aMagnitude>. |
|
652 |
Wrap if the resulting value is not a legal Character value. (JS)" |
|
653 |
||
6531
8798c9a1d1e6
arithmetic wraps at 16bit bounds (unicode)
Claus Gittinger <cg@exept.de>
parents:
6527
diff
changeset
|
654 |
^ Character value:(asciivalue // aMagnitude asInteger \\ 16rFFFF) |
1 | 655 |
! |
656 |
||
657 |
\\ aMagnitude |
|
658 |
"Return the Character who's value is the receiver modulo <aMagnitude>. |
|
659 |
Wrap if the resulting value is not a legal Character value. (JS)" |
|
660 |
||
6531
8798c9a1d1e6
arithmetic wraps at 16bit bounds (unicode)
Claus Gittinger <cg@exept.de>
parents:
6527
diff
changeset
|
661 |
^ Character value:(asciivalue \\ aMagnitude asInteger \\ 16rFFFF) |
1 | 662 |
! ! |
663 |
||
699 | 664 |
!Character methodsFor:'binary storage'! |
665 |
||
666 |
hasSpecialBinaryRepresentation |
|
667 |
"return true, if the receiver has a special binary representation" |
|
668 |
||
669 |
^ true |
|
670 |
! |
|
671 |
||
672 |
storeBinaryOn:stream manager:manager |
|
673 |
"store a binary representation of the receiver on stream; |
|
674 |
redefined, since single-byte characters are stored more compact |
|
675 |
with a special type-code followed by the asciiValue." |
|
676 |
||
677 |
(asciivalue < 256) ifTrue:[ |
|
4655
b9405ca0bb4e
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4340
diff
changeset
|
678 |
stream nextPut:manager codeForCharacter; nextPut:asciivalue. |
699 | 679 |
] ifFalse:[ |
4655
b9405ca0bb4e
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4340
diff
changeset
|
680 |
stream nextPut:manager codeForTwoByteCharacter. |
b9405ca0bb4e
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4340
diff
changeset
|
681 |
stream nextPutShort:asciivalue MSB:true |
699 | 682 |
] |
683 |
! ! |
|
684 |
||
685 |
!Character methodsFor:'comparing'! |
|
686 |
||
687 |
< aCharacter |
|
7799 | 688 |
"return true, if the arguments asciiValue is greater than the receiver's" |
699 | 689 |
|
5315
04052c5626bf
allow compare against integers (asciiValue compare).
Claus Gittinger <cg@exept.de>
parents:
4728
diff
changeset
|
690 |
^ (asciivalue < aCharacter asInteger) |
699 | 691 |
! |
692 |
||
693 |
<= aCharacter |
|
7799 | 694 |
"return true, if the arguments asciiValue is greater or equal to the receiver's" |
699 | 695 |
|
5315
04052c5626bf
allow compare against integers (asciiValue compare).
Claus Gittinger <cg@exept.de>
parents:
4728
diff
changeset
|
696 |
^ (asciivalue <= aCharacter asInteger) |
699 | 697 |
! |
698 |
||
699 |
= aCharacter |
|
700 |
"return true, if the argument, aCharacter is the same character |
|
701 |
Redefined to take care of 16bit characters." |
|
702 |
||
703 |
self == aCharacter ifTrue:[^ true]. |
|
704 |
aCharacter isCharacter ifFalse:[^ false]. |
|
705 |
^ (asciivalue = aCharacter asciiValue) |
|
706 |
! |
|
707 |
||
708 |
> aCharacter |
|
7799 | 709 |
"return true, if the arguments asciiValue is less than the receiver's" |
699 | 710 |
|
5315
04052c5626bf
allow compare against integers (asciiValue compare).
Claus Gittinger <cg@exept.de>
parents:
4728
diff
changeset
|
711 |
^ (asciivalue > aCharacter asInteger) |
699 | 712 |
! |
713 |
||
714 |
>= aCharacter |
|
7799 | 715 |
"return true, if the arguments asciiValue is less or equal to the receiver's" |
699 | 716 |
|
5315
04052c5626bf
allow compare against integers (asciiValue compare).
Claus Gittinger <cg@exept.de>
parents:
4728
diff
changeset
|
717 |
^ (asciivalue >= aCharacter asInteger) |
699 | 718 |
! |
719 |
||
5540 | 720 |
hash |
721 |
"return an integer useful for hashing" |
|
722 |
||
723 |
^ asciivalue |
|
724 |
! |
|
725 |
||
699 | 726 |
identityHash |
727 |
"return an integer useful for hashing on identity" |
|
728 |
||
729 |
asciivalue <= 255 ifTrue:[ |
|
730 |
^ 4096 + asciivalue |
|
731 |
]. |
|
732 |
^ super identityHash |
|
733 |
! |
|
734 |
||
735 |
sameAs:aCharacter |
|
736 |
"return true, if the argument, aCharacter is the same character, |
|
737 |
ignoring case differences." |
|
738 |
||
739 |
self == aCharacter ifTrue:[^ true]. |
|
740 |
^ self asLowercase = aCharacter asLowercase |
|
741 |
! |
|
742 |
||
743 |
~= aCharacter |
|
744 |
"return true, if the argument, aCharacter is not the same character |
|
745 |
Redefined to take care of 16bit characters." |
|
746 |
||
747 |
self == aCharacter ifTrue:[^ false]. |
|
748 |
aCharacter isCharacter ifFalse:[^ true]. |
|
749 |
^ (asciivalue ~~ aCharacter asciiValue) |
|
750 |
! ! |
|
751 |
||
752 |
!Character methodsFor:'converting'! |
|
753 |
||
754 |
asCharacter |
|
755 |
"usually sent to integers, but redefined here to allow integers |
|
756 |
and characters to be used commonly without a need for a test." |
|
757 |
||
758 |
^ self |
|
759 |
||
760 |
" |
|
761 |
32 asCharacter |
|
762 |
" |
|
763 |
! |
|
764 |
||
765 |
asInteger |
|
766 |
"return an Integer with my ascii-value. |
|
767 |
OWST4.2 compatibility (sigh)" |
|
768 |
||
769 |
^ asciivalue |
|
770 |
! |
|
771 |
||
772 |
asLowercase |
|
8010 | 773 |
"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
|
774 |
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
|
775 |
CAVEAT: |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
776 |
for now, this method is only correct for unicode characters up to u+1d6ff (Unicode3.1). |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
777 |
(which is more than mozilla does, btw. ;-)" |
7989
7907420b2fab
asUppercase / asLowercase for U0100..U04FF
Claus Gittinger <cg@exept.de>
parents:
7988
diff
changeset
|
778 |
|
8010 | 779 |
%{ |
8022
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
780 |
static const int |
8010 | 781 |
__mapping[] = { |
782 |
/* From To Every Diff */ |
|
783 |
0x0041, ((0x19 << 8) | 0x01), 0x0020 , |
|
784 |
0x00c0, ((0x16 << 8) | 0x01), 0x0020 , |
|
785 |
0x00d8, ((0x06 << 8) | 0x01), 0x0020 , |
|
786 |
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
|
787 |
0x0130, ((0x00 << 8) | 0x00), -199 , |
8010 | 788 |
0x0132, ((0x04 << 8) | 0x02), 0x0001 , |
789 |
0x0139, ((0x0e << 8) | 0x02), 0x0001 , |
|
790 |
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
|
791 |
0x0178, ((0x00 << 8) | 0x00), -121 , |
8010 | 792 |
0x0179, ((0x04 << 8) | 0x02), 0x0001 , |
793 |
0x0181, ((0x00 << 8) | 0x00), 0x00d2 , |
|
794 |
0x0182, ((0x02 << 8) | 0x02), 0x0001 , |
|
795 |
0x0186, ((0x00 << 8) | 0x00), 0x00ce , |
|
796 |
0x0187, ((0x00 << 8) | 0x00), 0x0001 , |
|
797 |
0x0189, ((0x01 << 8) | 0x01), 0x00cd , |
|
798 |
0x018b, ((0x00 << 8) | 0x00), 0x0001 , |
|
799 |
0x018e, ((0x00 << 8) | 0x00), 0x004f , |
|
800 |
0x018f, ((0x00 << 8) | 0x00), 0x00ca , |
|
801 |
0x0190, ((0x00 << 8) | 0x00), 0x00cb , |
|
802 |
0x0191, ((0x00 << 8) | 0x00), 0x0001 , |
|
803 |
0x0193, ((0x00 << 8) | 0x00), 0x00cd , |
|
804 |
0x0194, ((0x00 << 8) | 0x00), 0x00cf , |
|
805 |
0x0196, ((0x00 << 8) | 0x00), 0x00d3 , |
|
806 |
0x0197, ((0x00 << 8) | 0x00), 0x00d1 , |
|
807 |
0x0198, ((0x00 << 8) | 0x00), 0x0001 , |
|
808 |
0x019c, ((0x00 << 8) | 0x00), 0x00d3 , |
|
809 |
0x019d, ((0x00 << 8) | 0x00), 0x00d5 , |
|
810 |
0x019f, ((0x00 << 8) | 0x00), 0x00d6 , |
|
811 |
0x01a0, ((0x04 << 8) | 0x02), 0x0001 , |
|
812 |
0x01a6, ((0x00 << 8) | 0x00), 0x00da , |
|
813 |
0x01a7, ((0x00 << 8) | 0x00), 0x0001 , |
|
814 |
0x01a9, ((0x00 << 8) | 0x00), 0x00da , |
|
815 |
0x01ac, ((0x00 << 8) | 0x00), 0x0001 , |
|
816 |
0x01ae, ((0x00 << 8) | 0x00), 0x00da , |
|
817 |
0x01af, ((0x00 << 8) | 0x00), 0x0001 , |
|
818 |
0x01b1, ((0x01 << 8) | 0x01), 0x00d9 , |
|
819 |
0x01b3, ((0x02 << 8) | 0x02), 0x0001 , |
|
820 |
0x01b7, ((0x00 << 8) | 0x00), 0x00db , |
|
821 |
0x01b8, ((0x04 << 8) | 0x04), 0x0001 , |
|
822 |
0x01c4, ((0x00 << 8) | 0x00), 0x0002 , |
|
823 |
0x01c5, ((0x00 << 8) | 0x00), 0x0001 , |
|
824 |
0x01c7, ((0x00 << 8) | 0x00), 0x0002 , |
|
825 |
0x01c8, ((0x00 << 8) | 0x00), 0x0001 , |
|
826 |
0x01ca, ((0x00 << 8) | 0x00), 0x0002 , |
|
827 |
0x01cb, ((0x10 << 8) | 0x02), 0x0001 , |
|
828 |
0x01de, ((0x10 << 8) | 0x02), 0x0001 , |
|
829 |
0x01f1, ((0x00 << 8) | 0x00), 0x0002 , |
|
830 |
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
|
831 |
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
|
832 |
0x01f7, ((0x00 << 8) | 0x00), -56 , |
8010 | 833 |
0x01f8, ((0x26 << 8) | 0x02), 0x0001 , |
834 |
0x0222, ((0x10 << 8) | 0x02), 0x0001 , |
|
835 |
0x0386, ((0x00 << 8) | 0x00), 0x0026 , |
|
836 |
0x0388, ((0x02 << 8) | 0x01), 0x0025 , |
|
837 |
0x038c, ((0x00 << 8) | 0x00), 0x0040 , |
|
838 |
0x038e, ((0x01 << 8) | 0x01), 0x003f , |
|
839 |
0x0391, ((0x10 << 8) | 0x01), 0x0020 , |
|
840 |
0x03a3, ((0x08 << 8) | 0x01), 0x0020 , |
|
841 |
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
|
842 |
0x03f4, ((0x00 << 8) | 0x00), -60 , |
8010 | 843 |
0x0400, ((0x0f << 8) | 0x01), 0x0050 , |
844 |
0x0410, ((0x1f << 8) | 0x01), 0x0020 , |
|
845 |
0x0460, ((0x20 << 8) | 0x02), 0x0001 , |
|
846 |
0x048c, ((0x32 << 8) | 0x02), 0x0001 , |
|
847 |
0x04c1, ((0x02 << 8) | 0x02), 0x0001 , |
|
848 |
0x04c7, ((0x04 << 8) | 0x04), 0x0001 , |
|
849 |
0x04d0, ((0x24 << 8) | 0x02), 0x0001 , |
|
850 |
0x04f8, ((0x00 << 8) | 0x00), 0x0001 , |
|
851 |
0x0531, ((0x25 << 8) | 0x01), 0x0030 , |
|
852 |
0x1e00, ((0x94 << 8) | 0x02), 0x0001 , |
|
853 |
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
|
854 |
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
|
855 |
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
|
856 |
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
|
857 |
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
|
858 |
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
|
859 |
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
|
860 |
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
|
861 |
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
|
862 |
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
|
863 |
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
|
864 |
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
|
865 |
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
|
866 |
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
|
867 |
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
|
868 |
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
|
869 |
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
|
870 |
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
|
871 |
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
|
872 |
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
|
873 |
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
|
874 |
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
|
875 |
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
|
876 |
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
|
877 |
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
|
878 |
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
|
879 |
0x212b, ((0x00 << 8) | 0x00), -8262 , |
8010 | 880 |
0x2160, ((0x0f << 8) | 0x01), 0x0010 , |
881 |
0x24b6, ((0x19 << 8) | 0x01), 0x001a , |
|
8022
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
882 |
0xff21, ((0x19 << 8) | 0x01), 0x0020 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
883 |
0x10400, ((0x27 << 8) | 0x01), 0x0028 |
8010 | 884 |
}; |
1491
a42ae3fbb756
fixed asLowercase / asUppercase for national characters
Claus Gittinger <cg@exept.de>
parents:
1295
diff
changeset
|
885 |
|
8010 | 886 |
REGISTER unsigned __codePoint; |
8022
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
887 |
REGISTER int *__p; |
8010 | 888 |
|
889 |
__codePoint = __intVal(__INST(asciivalue)); |
|
890 |
for (__p = __mapping; __p < ((char *)__mapping) + sizeof(__mapping); __p += 3) { |
|
8022
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
891 |
unsigned rangeStart, rangeSize, rangeEnd, mod; |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
892 |
|
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
893 |
rangeStart = (unsigned)__p[0]; |
8010 | 894 |
if (__codePoint < rangeStart) break; |
7989
7907420b2fab
asUppercase / asLowercase for U0100..U04FF
Claus Gittinger <cg@exept.de>
parents:
7988
diff
changeset
|
895 |
|
8022
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
896 |
rangeSize = ((unsigned)__p[1]) >> 8; |
8010 | 897 |
rangeEnd = rangeStart + rangeSize; |
898 |
if (__codePoint <= rangeEnd) { |
|
899 |
mod = __p[1] & 0xFF; |
|
8022
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
900 |
if ((mod == 0) || (((__codePoint - rangeStart) % mod) == 0)) { |
8010 | 901 |
OBJ newChar; |
8022
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
902 |
unsigned newCodePoint; |
7989
7907420b2fab
asUppercase / asLowercase for U0100..U04FF
Claus Gittinger <cg@exept.de>
parents:
7988
diff
changeset
|
903 |
|
8010 | 904 |
newCodePoint = __codePoint + __p[2]; |
905 |
if (newCodePoint <= 0xFF) { |
|
906 |
RETURN (__MKCHARACTER(newCodePoint)) ; |
|
907 |
} |
|
8022
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
908 |
newChar = __MKUCHARACTER(newCodePoint) ; |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
909 |
if (newChar == nil) goto allocationError; |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
910 |
RETURN (newChar) ; |
8010 | 911 |
} |
912 |
RETURN (self); |
|
913 |
} |
|
914 |
} |
|
915 |
RETURN (self); |
|
8022
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
916 |
allocationError: ; |
8010 | 917 |
%}. |
918 |
^ ObjectMemory allocationFailureSignal raise. |
|
1491
a42ae3fbb756
fixed asLowercase / asUppercase for national characters
Claus Gittinger <cg@exept.de>
parents:
1295
diff
changeset
|
919 |
|
a42ae3fbb756
fixed asLowercase / asUppercase for national characters
Claus Gittinger <cg@exept.de>
parents:
1295
diff
changeset
|
920 |
" |
a42ae3fbb756
fixed asLowercase / asUppercase for national characters
Claus Gittinger <cg@exept.de>
parents:
1295
diff
changeset
|
921 |
$A asLowercase |
8010 | 922 |
$a asLowercase |
923 |
(Character value:16r01F5) asUppercase asLowercase |
|
924 |
(Character value:16r0205) asUppercase asLowercase |
|
925 |
(Character value:16r03B1) asUppercase asLowercase |
|
8022
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
926 |
(Character value:16r1E00) asLowercase |
8010 | 927 |
" |
699 | 928 |
! |
929 |
||
930 |
asString |
|
931 |
"return a string of len 1 with myself as contents" |
|
932 |
||
933 |
%{ /* NOCONTEXT */ |
|
934 |
char buffer[2]; |
|
935 |
OBJ s; |
|
995
b018368b3a94
asString to 16-bit char should return a twoByteString
Claus Gittinger <cg@exept.de>
parents:
819
diff
changeset
|
936 |
unsigned val; |
699 | 937 |
|
995
b018368b3a94
asString to 16-bit char should return a twoByteString
Claus Gittinger <cg@exept.de>
parents:
819
diff
changeset
|
938 |
val = __intVal(_characterVal(self)); |
b018368b3a94
asString to 16-bit char should return a twoByteString
Claus Gittinger <cg@exept.de>
parents:
819
diff
changeset
|
939 |
if (val <= 0xFF) { |
5407 | 940 |
buffer[0] = (char) val; |
941 |
buffer[1] = '\0'; |
|
8004
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
942 |
s = __MKSTRING_L(buffer, 1); |
5407 | 943 |
if (s != nil) { |
944 |
RETURN (s); |
|
945 |
} |
|
699 | 946 |
} |
8004
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
947 |
if (val <= 0xFFFF) { |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
948 |
s = __MKEMPTYUSTRING(1); |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
949 |
if (s != nil) { |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
950 |
__Unicode16StringInstPtr(s)->s_element[0] = val; |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
951 |
RETURN (s); |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
952 |
} |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
953 |
} |
699 | 954 |
%}. |
7951 | 955 |
asciivalue > 16rFF ifTrue:[ |
956 |
asciivalue > 16rFFFF ifTrue:[ |
|
8004
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
957 |
^ (Unicode32String new:1) at:1 put:self; yourself |
7951 | 958 |
]. |
8004
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
959 |
^ (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
|
960 |
]. |
b018368b3a94
asString to 16-bit char should return a twoByteString
Claus Gittinger <cg@exept.de>
parents:
819
diff
changeset
|
961 |
|
5407 | 962 |
^ (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
|
963 |
|
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
964 |
" |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
965 |
(Character value:16rB5) asString |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
966 |
(Character value:16r1B5) asString |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
967 |
" |
699 | 968 |
! |
969 |
||
970 |
asSymbol |
|
971 |
"return a unique symbol which prints like I print" |
|
972 |
||
973 |
^ Symbol internCharacter:self |
|
974 |
! |
|
975 |
||
8022
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
976 |
asTitlecase |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
977 |
"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
|
978 |
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
|
979 |
|
8026 | 980 |
" |
981 |
For example, in Unicode, character U+01F3 is LATIN SMALL LETTER DZ. |
|
982 |
(Let us write this compound character using ASCII as 'dz'.) |
|
983 |
This character uppercases to character U+01F1, LATIN CAPITAL LETTER DZ. |
|
984 |
(Which is basically 'DZ'.) |
|
985 |
But it titlecases to to character U+01F2, LATIN CAPITAL LETTER D WITH SMALL LETTER Z. |
|
986 |
(Which we can write 'Dz'.) |
|
987 |
||
988 |
character uppercase titlecase |
|
989 |
--------- --------- --------- |
|
990 |
dz DZ Dz |
|
991 |
" |
|
8022
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
992 |
|ch| |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
993 |
|
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
994 |
%{ |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
995 |
static const unsigned short |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
996 |
__mapping[] = { |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
997 |
0x01F1, 0x01F2, |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
998 |
0x01F3, 0x01F2, |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
999 |
0x01C4, 0x01C5, |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1000 |
0x01C6, 0x01C5, |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1001 |
0x01C7, 0x01C8, |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1002 |
0x01C9, 0x01C8, |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1003 |
0x01CA, 0x01CB, |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1004 |
0x01CC, 0x01CB, |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1005 |
}; |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1006 |
|
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1007 |
REGISTER unsigned __codePoint; |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1008 |
REGISTER short *__p; |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1009 |
|
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1010 |
__codePoint = __intVal(__INST(asciivalue)); |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1011 |
for (__p = __mapping; __p < ((char *)__mapping) + sizeof(__mapping); __p += 2) { |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1012 |
if ((__codePoint == __p[0]) || (__codePoint == __p[1])) { |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1013 |
short newCodePoint; |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1014 |
OBJ newChar; |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1015 |
|
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1016 |
newCodePoint = __p[1]; |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1017 |
if (newCodePoint == __codePoint) { |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1018 |
RETURN (self); |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1019 |
} |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1020 |
if (newCodePoint <= 0xFF) { |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1021 |
RETURN (__MKCHARACTER(newCodePoint)) ; |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1022 |
} |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1023 |
newChar = __MKUCHARACTER(newCodePoint) ; |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1024 |
if (newChar == nil) goto getOutOfHere; |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1025 |
RETURN (newChar) ; |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1026 |
} |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1027 |
} |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1028 |
ch = self; |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1029 |
getOutOfHere: ; |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1030 |
%}. |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1031 |
ch notNil ifTrue:[ |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1032 |
^ ch asUppercase. |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1033 |
]. |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1034 |
|
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1035 |
^ ObjectMemory allocationFailureSignal raise. |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1036 |
|
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1037 |
" |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1038 |
$A asTitlecase |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1039 |
$a asTitlecase |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1040 |
(Character value:16r01F1) asTitlecase |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1041 |
" |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1042 |
! |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1043 |
|
6029 | 1044 |
asUnicodeString |
8004
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1045 |
"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
|
1046 |
This will vanish, as we now (rel5.2.x) use Unicode as default." |
6029 | 1047 |
|
7951 | 1048 |
asciivalue > 16rFFFF ifTrue:[ |
1049 |
^ (Unicode32String new:1) at:1 put:self; yourself. |
|
1050 |
]. |
|
1051 |
^ (Unicode16String new:1) at:1 put:self; yourself. |
|
6029 | 1052 |
! |
1053 |
||
699 | 1054 |
asUppercase |
8010 | 1055 |
"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
|
1056 |
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
|
1057 |
CAVEAT: |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1058 |
for now, this method is only correct for unicode characters up to u+1d6ff (Unicode3.1). |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1059 |
(which is more than mozilla does, btw. ;-)" |
7990
2f78c1d609c7
asUppercase / asLowercase for UFF00..UFFFF
Claus Gittinger <cg@exept.de>
parents:
7989
diff
changeset
|
1060 |
|
8004
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1061 |
%{ |
8022
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1062 |
static const int |
8010 | 1063 |
__mapping[] = { |
8004
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1064 |
/* 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
|
1065 |
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
|
1066 |
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
|
1067 |
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
|
1068 |
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
|
1069 |
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
|
1070 |
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
|
1071 |
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
|
1072 |
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
|
1073 |
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
|
1074 |
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
|
1075 |
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
|
1076 |
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
|
1077 |
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
|
1078 |
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
|
1079 |
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
|
1080 |
0x0195, ((0x00 << 8) | 0x03), 0x0061 , |
8022
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1081 |
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
|
1082 |
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
|
1083 |
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
|
1084 |
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
|
1085 |
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
|
1086 |
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
|
1087 |
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
|
1088 |
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
|
1089 |
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
|
1090 |
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
|
1091 |
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
|
1092 |
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
|
1093 |
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
|
1094 |
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
|
1095 |
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
|
1096 |
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
|
1097 |
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
|
1098 |
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
|
1099 |
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
|
1100 |
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
|
1101 |
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
|
1102 |
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
|
1103 |
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
|
1104 |
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
|
1105 |
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
|
1106 |
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
|
1107 |
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
|
1108 |
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
|
1109 |
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
|
1110 |
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
|
1111 |
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
|
1112 |
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
|
1113 |
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
|
1114 |
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
|
1115 |
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
|
1116 |
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
|
1117 |
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
|
1118 |
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
|
1119 |
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
|
1120 |
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
|
1121 |
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
|
1122 |
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
|
1123 |
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
|
1124 |
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
|
1125 |
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
|
1126 |
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
|
1127 |
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
|
1128 |
0x03d6, ((0x00 << 8) | 0x01), -54 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1129 |
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
|
1130 |
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
|
1131 |
0x03f1, ((0x00 << 8) | 0x01), -80 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1132 |
0x03f2, ((0x00 << 8) | 0x01), -79 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1133 |
0x03f5, ((0x00 << 8) | 0x00), -96 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1134 |
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
|
1135 |
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
|
1136 |
0x0461, ((0x20 << 8) | 0x02), -1 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1137 |
0x048d, ((0x32 << 8) | 0x02), -1 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1138 |
0x04c2, ((0x02 << 8) | 0x02), -1 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1139 |
0x04c8, ((0x04 << 8) | 0x04), -1 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1140 |
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
|
1141 |
0x04f9, ((0x00 << 8) | 0x04), -1 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1142 |
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
|
1143 |
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
|
1144 |
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
|
1145 |
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
|
1146 |
0x1f00, ((0x07 << 8) | 0x01), 0x0008 , |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1147 |
0x1f10, ((0x05 << 8) | 0x01), 0x0008 , |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1148 |
0x1f20, ((0x07 << 8) | 0x01), 0x0008 , |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1149 |
0x1f30, ((0x07 << 8) | 0x01), 0x0008 , |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1150 |
0x1f40, ((0x05 << 8) | 0x01), 0x0008 , |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1151 |
0x1f51, ((0x06 << 8) | 0x02), 0x0008 , |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1152 |
0x1f60, ((0x07 << 8) | 0x01), 0x0008 , |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1153 |
0x1f70, ((0x01 << 8) | 0x01), 0x004a , |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1154 |
0x1f72, ((0x03 << 8) | 0x01), 0x0056 , |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1155 |
0x1f76, ((0x01 << 8) | 0x01), 0x0064 , |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1156 |
0x1f78, ((0x01 << 8) | 0x01), 0x0080 , |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1157 |
0x1f7a, ((0x01 << 8) | 0x01), 0x0070 , |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1158 |
0x1f7c, ((0x01 << 8) | 0x01), 0x007e , |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1159 |
0x1f80, ((0x07 << 8) | 0x01), 0x0008 , |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1160 |
0x1f90, ((0x07 << 8) | 0x01), 0x0008 , |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1161 |
0x1fa0, ((0x07 << 8) | 0x01), 0x0008 , |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1162 |
0x1fb0, ((0x01 << 8) | 0x01), 0x0008 , |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1163 |
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
|
1164 |
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
|
1165 |
0x1fc3, ((0x00 << 8) | 0x05), 0x0009 , |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1166 |
0x1fd0, ((0x01 << 8) | 0x01), 0x0008 , |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1167 |
0x1fe0, ((0x01 << 8) | 0x01), 0x0008 , |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1168 |
0x1fe5, ((0x00 << 8) | 0x04), 0x0007 , |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1169 |
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
|
1170 |
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
|
1171 |
0x24d0, ((0x19 << 8) | 0x01), -26 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1172 |
0xff41, ((0x19 << 8) | 0x01), -32 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1173 |
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
|
1174 |
}; |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1175 |
|
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1176 |
REGISTER unsigned __codePoint; |
8022
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1177 |
REGISTER int *__p; |
8004
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1178 |
|
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1179 |
__codePoint = __intVal(__INST(asciivalue)); |
8010 | 1180 |
for (__p = __mapping; __p < ((char *)__mapping) + sizeof(__mapping); __p += 3) { |
8022
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1181 |
unsigned rangeStart, rangeSize, rangeEnd, mod; |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1182 |
|
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1183 |
rangeStart = (unsigned)__p[0]; |
8004
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1184 |
if (__codePoint < rangeStart) break; |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1185 |
|
8022
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1186 |
rangeSize = ((unsigned)__p[1]) >> 8; |
8004
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1187 |
rangeEnd = rangeStart + rangeSize; |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1188 |
if (__codePoint <= rangeEnd) { |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1189 |
mod = __p[1] & 0xFF; |
8022
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1190 |
if ((mod == 0) || (((__codePoint - rangeStart) % mod) == 0)) { |
8004
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1191 |
OBJ newChar; |
8022
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1192 |
unsigned newCodePoint; |
8004
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1193 |
|
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1194 |
newCodePoint = __codePoint + __p[2]; |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1195 |
if (newCodePoint <= 0xFF) { |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1196 |
RETURN (__MKCHARACTER(newCodePoint)) ; |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1197 |
} |
8022
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1198 |
newChar = __MKUCHARACTER(newCodePoint) ; |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1199 |
if (newChar == nil) goto allocationError; |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1200 |
RETURN (newChar) ; |
8004
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1201 |
} |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1202 |
RETURN (self); |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1203 |
} |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1204 |
} |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1205 |
RETURN (self); |
8022
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1206 |
allocationError: ; |
8004
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1207 |
%}. |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1208 |
^ ObjectMemory allocationFailureSignal raise. |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1209 |
|
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1210 |
" |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1211 |
$A asLowercase |
8010 | 1212 |
$a asUppercase |
1213 |
(Character value:16r01F5) asUppercase |
|
1214 |
(Character value:16r0205) asUppercase |
|
1215 |
(Character value:16r03B1) asUppercase |
|
1216 |
" |
|
1217 |
! |
|
8004
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1218 |
|
8010 | 1219 |
decodeAsLiteralArray |
1220 |
"given a literalEncoding in the receiver, |
|
1221 |
create & return the corresponding object. |
|
1222 |
The inverse operation to #literalArrayEncoding." |
|
1223 |
||
1224 |
^ self |
|
1225 |
||
1226 |
"Created: / 27.10.1997 / 14:40:16 / cg" |
|
1227 |
! |
|
1228 |
||
1229 |
digitValue |
|
1230 |
"return my digitValue for any base" |
|
1231 |
||
1232 |
|ascii "{ Class: SmallInteger }" | |
|
8004
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1233 |
|
8010 | 1234 |
ascii := asciivalue. |
1235 |
(ascii between:($0 asciiValue) and:($9 asciiValue)) ifTrue:[ |
|
1236 |
^ ascii - $0 asciiValue |
|
1237 |
]. |
|
1238 |
(ascii between:($a asciiValue) and:($z asciiValue)) ifTrue:[ |
|
1239 |
^ ascii + (10 - $a asciiValue) |
|
1240 |
]. |
|
1241 |
(ascii between:($A asciiValue) and:($Z asciiValue)) ifTrue:[ |
|
1242 |
^ ascii + (10 - $A asciiValue) |
|
1243 |
]. |
|
8004
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1244 |
|
8010 | 1245 |
"remove error below for X3J20 conformance ... " |
1246 |
self error:'bad character'. |
|
1247 |
" " |
|
1248 |
^ -1 |
|
1249 |
! |
|
1250 |
||
1251 |
literalArrayEncoding |
|
1252 |
"encode myself as an array literal, from which a copy of the receiver |
|
1253 |
can be reconstructed with #decodeAsLiteralArray." |
|
1254 |
||
1255 |
^ self |
|
1256 |
||
1257 |
"Created: / 27.10.1997 / 14:40:37 / cg" |
|
1258 |
! |
|
1259 |
||
1260 |
to:aMagnitude |
|
1261 |
"Return an Interval over the characters from the receiver to <aMagnitude>. |
|
1262 |
Wrap <aMagnitude> if it is not a legal Character value. (JS)" |
|
1263 |
||
1264 |
^ Interval from:self to:(aMagnitude \\ 256) |
|
8004
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1265 |
! |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1266 |
|
5847 | 1267 |
utf8Encoded |
1268 |
"convert a character from ISO8859-1 to its UTF-8 encoding. |
|
1269 |
this returns a String" |
|
1270 |
||
1271 |
|s| |
|
1272 |
||
7897 | 1273 |
asciivalue <= 16r7F ifTrue:[ |
1274 |
^ self asString. |
|
1275 |
]. |
|
1276 |
||
5847 | 1277 |
s := (String new:6) writeStream. |
1278 |
self utf8EncodedOn:s. |
|
1279 |
^ s contents |
|
1280 |
! |
|
1281 |
||
1282 |
utf8EncodedOn:aStream |
|
6808 | 1283 |
"append my UTF-8 representation to the argument, aStream. |
1284 |
Up to 31 bits can be encoded in up to 6 bytes. |
|
1285 |
However, currently, characters are limited to 16 bits." |
|
5847 | 1286 |
|
1287 |
|b1 b2 b3 b4 b5 v| |
|
1288 |
||
1289 |
asciivalue <= 16r7F ifTrue:[ |
|
1290 |
aStream nextPut:self. |
|
1291 |
^ self. |
|
1292 |
]. |
|
1293 |
||
6808 | 1294 |
b1 := Character value:((asciivalue bitAnd:16r3F) bitOr:2r10000000). |
5847 | 1295 |
v := asciivalue bitShift:-6. |
1296 |
v <= 16r1F ifTrue:[ |
|
6808 | 1297 |
aStream nextPut:(Character value:(v bitOr:2r11000000)). |
5847 | 1298 |
aStream nextPut:b1. |
1299 |
^ self. |
|
1300 |
]. |
|
6808 | 1301 |
b2 := Character value:((v bitAnd:16r3F) bitOr:2r10000000). |
5847 | 1302 |
v := v bitShift:-6. |
1303 |
v <= 16r0F ifTrue:[ |
|
6808 | 1304 |
aStream nextPut:(Character value:(v bitOr:2r11100000)). |
7897 | 1305 |
aStream nextPut:b2; nextPut:b1. |
5847 | 1306 |
^ self. |
1307 |
]. |
|
6808 | 1308 |
b3 := Character value:((v bitAnd:16r3F) bitOr:2r10000000). |
5847 | 1309 |
v := v bitShift:-6. |
1310 |
v <= 16r07 ifTrue:[ |
|
6808 | 1311 |
aStream nextPut:(Character value:(v bitOr:2r11110000)). |
7897 | 1312 |
aStream nextPut:b3; nextPut:b2; nextPut:b1. |
5847 | 1313 |
^ self. |
1314 |
]. |
|
6808 | 1315 |
b4 := Character value:((v bitAnd:16r3F) bitOr:2r10000000). |
5847 | 1316 |
v := v bitShift:-6. |
1317 |
v <= 16r03 ifTrue:[ |
|
6808 | 1318 |
aStream nextPut:(Character value:(v bitOr:2r11111000)). |
7897 | 1319 |
aStream nextPut:b4; nextPut:b3; nextPut:b2; nextPut:b1. |
5847 | 1320 |
^ self. |
1321 |
]. |
|
6808 | 1322 |
b5 := Character value:((v bitAnd:16r3F) bitOr:2r10000000). |
5847 | 1323 |
v := v bitShift:-6. |
1324 |
v <= 16r01 ifTrue:[ |
|
6808 | 1325 |
aStream nextPut:(Character value:(v bitOr:2r11111100)). |
7897 | 1326 |
aStream nextPut:b5; nextPut:b4; nextPut:b3; nextPut:b2; nextPut:b1. |
5847 | 1327 |
^ self. |
1328 |
]. |
|
6808 | 1329 |
"/ cannot happen - we only support up to 16 bit characters |
1330 |
self error:'ascii value > 31bit in utf8Encode'. |
|
5847 | 1331 |
|
1332 |
" |
|
6527 | 1333 |
$a utf8Encoded |
1334 |
$ü utf8Encoded asByteArray |
|
1335 |
(Character value:16r1fff) utf8Encoded asByteArray |
|
6808 | 1336 |
(Character value:16rffff) utf8Encoded asByteArray |
1337 |
(Character value:16r800) utf8Encoded asByteArray |
|
5847 | 1338 |
" |
699 | 1339 |
! ! |
1340 |
||
1341 |
!Character methodsFor:'copying'! |
|
1342 |
||
1343 |
copy |
|
1344 |
"return a copy of myself |
|
1345 |
reimplemented since characters are unique" |
|
1346 |
||
1347 |
^ self |
|
1348 |
! |
|
1349 |
||
2214 | 1350 |
copyUpToLast: char |
1351 |
||
1352 |
^self |
|
1353 |
! |
|
1354 |
||
699 | 1355 |
deepCopyUsing:aDictionary |
1356 |
"return a deep copy of myself |
|
4728 | 1357 |
reimplemented since characters are immutable" |
699 | 1358 |
|
1359 |
^ self |
|
1360 |
! |
|
1361 |
||
1362 |
shallowCopy |
|
1363 |
"return a shallow copy of myself |
|
4728 | 1364 |
reimplemented since characters are immutable" |
699 | 1365 |
|
1366 |
^ self |
|
1367 |
! |
|
1368 |
||
1369 |
simpleDeepCopy |
|
1370 |
"return a deep copy of myself |
|
4728 | 1371 |
reimplemented since characters are immutable" |
699 | 1372 |
|
1373 |
^ self |
|
1374 |
! ! |
|
1375 |
||
5471
a57eeb01c5ab
General encoding method (#encodeOn:with:)
Stefan Vogel <sv@exept.de>
parents:
5452
diff
changeset
|
1376 |
!Character methodsFor:'encoding'! |
a57eeb01c5ab
General encoding method (#encodeOn:with:)
Stefan Vogel <sv@exept.de>
parents:
5452
diff
changeset
|
1377 |
|
a57eeb01c5ab
General encoding method (#encodeOn:with:)
Stefan Vogel <sv@exept.de>
parents:
5452
diff
changeset
|
1378 |
encodeOn:anEncoder with:aParameter |
a57eeb01c5ab
General encoding method (#encodeOn:with:)
Stefan Vogel <sv@exept.de>
parents:
5452
diff
changeset
|
1379 |
|
a57eeb01c5ab
General encoding method (#encodeOn:with:)
Stefan Vogel <sv@exept.de>
parents:
5452
diff
changeset
|
1380 |
anEncoder encodeCharacter:self with:aParameter |
a57eeb01c5ab
General encoding method (#encodeOn:with:)
Stefan Vogel <sv@exept.de>
parents:
5452
diff
changeset
|
1381 |
|
a57eeb01c5ab
General encoding method (#encodeOn:with:)
Stefan Vogel <sv@exept.de>
parents:
5452
diff
changeset
|
1382 |
|
6508 | 1383 |
! |
1384 |
||
1385 |
rot13 |
|
1386 |
"Usenet: from `rotate alphabet 13 places'] |
|
1387 |
The simple Caesar-cypher encryption that replaces each English |
|
1388 |
letter with the one 13 places forward or back along the alphabet, |
|
1389 |
so that 'The butler did it!!' becomes 'Gur ohgyre qvq vg!!' |
|
1390 |
Most Usenet news reading and posting programs include a rot13 feature. |
|
1391 |
It is used to enclose the text in a sealed wrapper that the reader must choose |
|
1392 |
to open -- e.g., for posting things that might offend some readers, or spoilers. |
|
1393 |
A major advantage of rot13 over rot(N) for other N is that it |
|
1394 |
is self-inverse, so the same code can be used for encoding and decoding." |
|
1395 |
||
7715
0e69a830f5d8
use #and: - not #& you lazy bone, you
Claus Gittinger <cg@exept.de>
parents:
7689
diff
changeset
|
1396 |
(((self >= $a) and:[ self < $n]) or:[(self >= $A) and:[ self < $N]]) |
6508 | 1397 |
ifTrue: [ ^ Character value:(self asciiValue + 13) ]. |
7715
0e69a830f5d8
use #and: - not #& you lazy bone, you
Claus Gittinger <cg@exept.de>
parents:
7689
diff
changeset
|
1398 |
(((self > $m) and:[ self <= $z]) or:[(self > $M) and:[ self <= $Z]]) |
6508 | 1399 |
ifTrue: [ ^ Character value:(self asciiValue - 13) ]. |
1400 |
^ self |
|
1401 |
||
1402 |
" |
|
7715
0e69a830f5d8
use #and: - not #& you lazy bone, you
Claus Gittinger <cg@exept.de>
parents:
7689
diff
changeset
|
1403 |
$h rot13 |
0e69a830f5d8
use #and: - not #& you lazy bone, you
Claus Gittinger <cg@exept.de>
parents:
7689
diff
changeset
|
1404 |
$h rot13 rot13 |
0e69a830f5d8
use #and: - not #& you lazy bone, you
Claus Gittinger <cg@exept.de>
parents:
7689
diff
changeset
|
1405 |
'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
|
1406 |
'The butler did it!!' rot13 rot13 -> 'The butler did it!!' |
6508 | 1407 |
" |
5471
a57eeb01c5ab
General encoding method (#encodeOn:with:)
Stefan Vogel <sv@exept.de>
parents:
5452
diff
changeset
|
1408 |
! ! |
a57eeb01c5ab
General encoding method (#encodeOn:with:)
Stefan Vogel <sv@exept.de>
parents:
5452
diff
changeset
|
1409 |
|
699 | 1410 |
!Character methodsFor:'national testing'! |
1411 |
||
1412 |
isNationalAlphaNumeric |
|
2214 | 1413 |
"return true, if the receiver is a letter or digit in the |
699 | 1414 |
current language (Language variable)" |
1415 |
||
7988
cb1c920e67eb
isUppercase / isLowercase unicode changes
Claus Gittinger <cg@exept.de>
parents:
7987
diff
changeset
|
1416 |
self isNationalLetter ifTrue:[^ true]. |
cb1c920e67eb
isUppercase / isLowercase unicode changes
Claus Gittinger <cg@exept.de>
parents:
7987
diff
changeset
|
1417 |
^ self isDigit |
cb1c920e67eb
isUppercase / isLowercase unicode changes
Claus Gittinger <cg@exept.de>
parents:
7987
diff
changeset
|
1418 |
! |
cb1c920e67eb
isUppercase / isLowercase unicode changes
Claus Gittinger <cg@exept.de>
parents:
7987
diff
changeset
|
1419 |
|
cb1c920e67eb
isUppercase / isLowercase unicode changes
Claus Gittinger <cg@exept.de>
parents:
7987
diff
changeset
|
1420 |
isNationalDigit |
cb1c920e67eb
isUppercase / isLowercase unicode changes
Claus Gittinger <cg@exept.de>
parents:
7987
diff
changeset
|
1421 |
"return true, if the receiver is a digit. |
cb1c920e67eb
isUppercase / isLowercase unicode changes
Claus Gittinger <cg@exept.de>
parents:
7987
diff
changeset
|
1422 |
This assumes unicode encoding. |
cb1c920e67eb
isUppercase / isLowercase unicode changes
Claus Gittinger <cg@exept.de>
parents:
7987
diff
changeset
|
1423 |
WARNING: this method is not complete." |
699 | 1424 |
|
7988
cb1c920e67eb
isUppercase / isLowercase unicode changes
Claus Gittinger <cg@exept.de>
parents:
7987
diff
changeset
|
1425 |
|codePoint "{ Class SmallInteger }"| |
cb1c920e67eb
isUppercase / isLowercase unicode changes
Claus Gittinger <cg@exept.de>
parents:
7987
diff
changeset
|
1426 |
|
cb1c920e67eb
isUppercase / isLowercase unicode changes
Claus Gittinger <cg@exept.de>
parents:
7987
diff
changeset
|
1427 |
codePoint := asciivalue. |
2214 | 1428 |
|
7988
cb1c920e67eb
isUppercase / isLowercase unicode changes
Claus Gittinger <cg@exept.de>
parents:
7987
diff
changeset
|
1429 |
codePoint <= 16rFF ifTrue:[ "/ u00xx - unicode latin1 page |
cb1c920e67eb
isUppercase / isLowercase unicode changes
Claus Gittinger <cg@exept.de>
parents:
7987
diff
changeset
|
1430 |
(codePoint between:($0 asciiValue) and:($9 asciiValue)) ifTrue:[^ true]. |
cb1c920e67eb
isUppercase / isLowercase unicode changes
Claus Gittinger <cg@exept.de>
parents:
7987
diff
changeset
|
1431 |
^ false |
cb1c920e67eb
isUppercase / isLowercase unicode changes
Claus Gittinger <cg@exept.de>
parents:
7987
diff
changeset
|
1432 |
]. |
7990
2f78c1d609c7
asUppercase / asLowercase for UFF00..UFFFF
Claus Gittinger <cg@exept.de>
parents:
7989
diff
changeset
|
1433 |
|
2f78c1d609c7
asUppercase / asLowercase for UFF00..UFFFF
Claus Gittinger <cg@exept.de>
parents:
7989
diff
changeset
|
1434 |
(codePoint between:16rFF10 and:16rFF19) ifTrue:[ ^ true]. |
7988
cb1c920e67eb
isUppercase / isLowercase unicode changes
Claus Gittinger <cg@exept.de>
parents:
7987
diff
changeset
|
1435 |
^ false. |
699 | 1436 |
! |
1437 |
||
1438 |
isNationalLetter |
|
7988
cb1c920e67eb
isUppercase / isLowercase unicode changes
Claus Gittinger <cg@exept.de>
parents:
7987
diff
changeset
|
1439 |
"return true, if the receiver is a letter. |
8022
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1440 |
CAVEAT: |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1441 |
for now, this method is only correct for unicode characters up to u+1d6ff (Unicode3.1). |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1442 |
(which is more than mozilla does, btw. ;-)" |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1443 |
|
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1444 |
%{ /* NOCONTEXT */ |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1445 |
|
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1446 |
REGISTER int val; |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1447 |
|
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1448 |
val = __intVal(__INST(asciivalue)); |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1449 |
switch (val >> 8) { |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1450 |
case 0x00: |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1451 |
if ((unsigned)(val - 'A') <= ('Z' - 'A')) { |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1452 |
RETURN ( true ); |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1453 |
} |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1454 |
if ((unsigned)(val - 'a') <= ('z' - 'a')) { |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1455 |
RETURN ( true ); |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1456 |
} |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1457 |
if (val == 0xAA) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1458 |
if (val == 0xB5) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1459 |
if (val == 0xBA) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1460 |
if (val < 0xC0) { RETURN (false); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1461 |
if (val == 0xD7) { RETURN (false); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1462 |
if (val == 0xF7) { RETURN (false); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1463 |
RETURN (true); |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1464 |
|
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1465 |
case 0x01: |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1466 |
RETURN (true); |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1467 |
|
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1468 |
case 0x02: |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1469 |
if (val <= 0x2B8) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1470 |
if (val == 0x2B9) { RETURN (false); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1471 |
if (val == 0x2BA) { RETURN (false); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1472 |
if (val <= 0x2C1) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1473 |
if (val == 0x2D0) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1474 |
if (val == 0x2D1) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1475 |
if (val <= 0x2DF) { RETURN (false); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1476 |
if (val <= 0x2E4) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1477 |
if (val == 0x2EE) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1478 |
RETURN (false); |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1479 |
|
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1480 |
case 0x03: |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1481 |
if (val == 0x37A) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1482 |
if (val <= 0x385) { RETURN (false); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1483 |
if (val == 0x387) { RETURN (false); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1484 |
RETURN (true); |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1485 |
|
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1486 |
case 0x04: |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1487 |
if (val <= 0x481) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1488 |
if (val <= 0x486) { RETURN (false); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1489 |
if (val == 0x487) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1490 |
if (val <= 0x48A) { RETURN (false); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1491 |
RETURN (true); |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1492 |
|
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1493 |
case 0x05: |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1494 |
if (val <= 0x50f) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1495 |
if (val <= 0x530) { RETURN (false); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1496 |
if (val <= 0x556) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1497 |
if (val <= 0x558) { RETURN (false); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1498 |
if (val <= 0x559) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1499 |
if (val <= 0x55F) { RETURN (false); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1500 |
if (val <= 0x587) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1501 |
if (val <= 0x5cf) { RETURN (false); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1502 |
if (val <= 0x5f2) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1503 |
RETURN (false); |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1504 |
|
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1505 |
case 0x06: |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1506 |
if (val <= 0x620) { RETURN (false); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1507 |
if (val <= 0x64A) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1508 |
if (val <= 0x66D) { RETURN (false); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1509 |
if (val == 0x670) { RETURN (false); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1510 |
if (val <= 0x6D3) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1511 |
if (val == 0x6D5) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1512 |
if (val == 0x6E5) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1513 |
if (val == 0x6E6) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1514 |
if (val == 0x6EE) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1515 |
if (val == 0x6EF) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1516 |
if (val == 0x6FA) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1517 |
if (val == 0x6FB) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1518 |
if (val == 0x6FC) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1519 |
RETURN (false); |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1520 |
|
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1521 |
case 0x07: |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1522 |
if (val <= 0x70F) { RETURN (false); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1523 |
if (val == 0x711) { RETURN (false); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1524 |
if (val <= 0x72F) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1525 |
if (val <= 0x74d) { RETURN (false); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1526 |
if (val <= 0x74e) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1527 |
if (val <= 0x77F) { RETURN (false); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1528 |
if (val <= 0x7a5) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1529 |
if (val <= 0x7af) { RETURN (false); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1530 |
RETURN (false); |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1531 |
|
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1532 |
case 0x09: |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1533 |
if (val <= 0x904) { RETURN (false); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1534 |
if (val <= 0x93B) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1535 |
if (val == 0x93D) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1536 |
if (val == 0x950) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1537 |
if (val <= 0x957) { RETURN (false); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1538 |
if (val <= 0x961) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1539 |
if (val <= 0x984) { RETURN (false); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1540 |
if (val <= 0x9BB) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1541 |
if (val <= 0x9DB) { RETURN (false); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1542 |
if (val <= 0x9E1) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1543 |
if (val <= 0x9EF) { RETURN (false); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1544 |
if (val <= 0x9F1) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1545 |
RETURN (false); |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1546 |
|
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1547 |
case 0x0A: |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1548 |
if (val <= 0xa04) { RETURN (false); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1549 |
if (val <= 0xa3B) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1550 |
if (val <= 0xa58) { RETURN (false); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1551 |
if (val <= 0xa65) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1552 |
if (val <= 0xa71) { RETURN (false); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1553 |
if (val <= 0xa80) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1554 |
if (val <= 0xa84) { RETURN (false); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1555 |
if (val <= 0xaBB) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1556 |
if (val == 0xaBD) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1557 |
if (val <= 0xaCF) { RETURN (false); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1558 |
if (val <= 0xaE5) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1559 |
RETURN (false); |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1560 |
|
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1561 |
case 0x0B: |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1562 |
if (val <= 0xB04) { RETURN (false); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1563 |
if (val <= 0xb3B) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1564 |
if (val == 0xb3d) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1565 |
if (val <= 0xb5B) { RETURN (false); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1566 |
if (val <= 0xb65) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1567 |
if (val <= 0xb84) { RETURN (false); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1568 |
if (val <= 0xbBB) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1569 |
RETURN (false); |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1570 |
|
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1571 |
case 0x0c: |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1572 |
if (val <= 0xc04) { RETURN (false); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1573 |
if (val <= 0xc3d) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1574 |
if (val <= 0xc5f) { RETURN (false); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1575 |
if (val <= 0xc65) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1576 |
if (val <= 0xc84) { RETURN (false); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1577 |
if (val <= 0xcbd) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1578 |
if (val <= 0xcdc) { RETURN (false); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1579 |
if (val <= 0xce5) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1580 |
RETURN (false); |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1581 |
|
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1582 |
case 0x0d: |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1583 |
if (val <= 0xd04) { RETURN (false); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1584 |
if (val <= 0xd3d) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1585 |
if (val <= 0xd5f) { RETURN (false); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1586 |
if (val <= 0xd65) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1587 |
if (val <= 0xd84) { RETURN (false); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1588 |
if (val <= 0xdc9) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1589 |
RETURN (false); |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1590 |
|
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1591 |
case 0x0E: |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1592 |
if (val == 0xE31) { RETURN (false); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1593 |
if (val <= 0xE33) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1594 |
if (val <= 0xE3F) { RETURN (false); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1595 |
if (val <= 0xE46) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1596 |
if (val <= 0xE7f) { RETURN (false); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1597 |
if (val <= 0xEb0) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1598 |
if (val == 0xEb1) { RETURN (false); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1599 |
if (val <= 0xEb3) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1600 |
if (val <= 0xEbc) { RETURN (false); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1601 |
if (val <= 0xEc7) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1602 |
if (val <= 0xEdb) { RETURN (false); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1603 |
RETURN (true); |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1604 |
|
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1605 |
case 0x0F: |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1606 |
if (val == 0xf00) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1607 |
if (val <= 0xf3F) { RETURN (false); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1608 |
if (val <= 0xf70) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1609 |
if (val <= 0xf87) { RETURN (false); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1610 |
if (val <= 0xf8f) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1611 |
RETURN (false); |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1612 |
|
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1613 |
case 0x10: |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1614 |
if (val <= 0x102b) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1615 |
if (val <= 0x104f) { RETURN (false); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1616 |
if (val <= 0x1055) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1617 |
if (val <= 0x109f) { RETURN (false); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1618 |
if (val <= 0x10fa) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1619 |
RETURN (false); |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1620 |
|
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1621 |
case 0x11: |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1622 |
case 0x12: |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1623 |
RETURN (true); |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1624 |
|
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1625 |
case 0x13: |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1626 |
if (val <= 0x1360) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1627 |
if (val <= 0x139f) { RETURN (false); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1628 |
RETURN (true); |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1629 |
|
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1630 |
case 0x14: |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1631 |
case 0x15: |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1632 |
RETURN (true); |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1633 |
|
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1634 |
case 0x16: |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1635 |
if (val == 0x166d) { RETURN (false); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1636 |
if (val == 0x166e) { RETURN (false); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1637 |
if (val == 0x1680) { RETURN (false); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1638 |
if (val == 0x169b) { RETURN (false); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1639 |
if (val == 0x169c) { RETURN (false); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1640 |
if (val <= 0x16ea) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1641 |
RETURN (false); |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1642 |
|
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1643 |
case 0x17: |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1644 |
if (val <= 0x17b3) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1645 |
RETURN (false); |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1646 |
|
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1647 |
case 0x18: |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1648 |
if (val <= 0x181f) { RETURN (false); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1649 |
if (val <= 0x18a8) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1650 |
RETURN (false); |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1651 |
|
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1652 |
case 0x1e: |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1653 |
RETURN (true); |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1654 |
|
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1655 |
case 0x1f: |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1656 |
if (val <= 0x1fbc) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1657 |
if (val == 0x1fbe) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1658 |
if (val <= 0x1fc1) { RETURN (false); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1659 |
if (val <= 0x1fcc) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1660 |
if (val <= 0x1fcf) { RETURN (false); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1661 |
if (val <= 0x1fdc) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1662 |
if (val <= 0x1fdf) { RETURN (false); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1663 |
if (val <= 0x1fec) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1664 |
if (val <= 0x1ff1) { RETURN (false); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1665 |
if (val <= 0x1ffc) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1666 |
RETURN (false); |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1667 |
|
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1668 |
case 0x20: |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1669 |
if (val == 0x207f) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1670 |
RETURN (false); |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1671 |
|
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1672 |
case 0x21: |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1673 |
if (val == 0x2102) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1674 |
if (val == 0x2107) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1675 |
if (val <= 0x2109) { RETURN (false); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1676 |
if (val <= 0x2113) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1677 |
if (val == 0x2115) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1678 |
if (val <= 0x2118) { RETURN (false); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1679 |
if (val <= 0x211d) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1680 |
if (val <= 0x2123) { RETURN (false); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1681 |
if (val == 0x2125) { RETURN (false); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1682 |
if (val == 0x2127) { RETURN (false); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1683 |
if (val == 0x2129) { RETURN (false); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1684 |
if (val == 0x212E) { RETURN (false); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1685 |
if (val == 0x2132) { RETURN (false); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1686 |
if (val == 0x213A) { RETURN (false); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1687 |
if (val <= 0x2152) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1688 |
RETURN (false); |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1689 |
|
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1690 |
case 0x30: |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1691 |
if (val == 0x3005) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1692 |
if (val == 0x3006) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1693 |
if (val <= 0x3030) { RETURN (false); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1694 |
if (val <= 0x3035) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1695 |
if (val <= 0x3040) { RETURN (false); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1696 |
if (val <= 0x3098) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1697 |
if (val <= 0x309c) { RETURN (false); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1698 |
if (val == 0x30Fb) { RETURN (false); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1699 |
RETURN ((true)); |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1700 |
|
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1701 |
case 0x31: |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1702 |
if (val <= 0x318f) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1703 |
if (val <= 0x319F) { RETURN (false); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1704 |
RETURN ((true)); |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1705 |
|
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1706 |
case 0x34: |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1707 |
RETURN ((true)); |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1708 |
|
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1709 |
case 0x4d: |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1710 |
if (val <= 0x4db4) { RETURN (false); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1711 |
RETURN (true); |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1712 |
|
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1713 |
case 0x4e: |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1714 |
RETURN ((true)); |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1715 |
|
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1716 |
case 0x9f: |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1717 |
if (val <= 0x9fa4) { RETURN (false); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1718 |
RETURN (true); |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1719 |
|
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1720 |
case 0xA0: |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1721 |
case 0xA1: |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1722 |
case 0xA2: |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1723 |
case 0xA3: |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1724 |
RETURN (true); |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1725 |
|
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1726 |
case 0xA4: |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1727 |
if (val <= 0xa48f) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1728 |
RETURN (false); |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1729 |
|
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1730 |
case 0xA5: |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1731 |
RETURN (true); |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1732 |
|
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1733 |
case 0xAC: |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1734 |
RETURN (true); |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1735 |
|
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1736 |
case 0xD7: |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1737 |
RETURN (true); |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1738 |
|
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1739 |
case 0xF9: |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1740 |
case 0xFA: |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1741 |
RETURN (true); |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1742 |
|
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1743 |
case 0xFB: |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1744 |
if (val == 0xfb1e) { RETURN (false); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1745 |
if (val == 0xfb29) { RETURN (false); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1746 |
RETURN (true); |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1747 |
|
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1748 |
case 0xFC: |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1749 |
RETURN (true); |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1750 |
|
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1751 |
case 0xFD: |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1752 |
if (val <= 0xFD3d) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1753 |
if (val <= 0xFD4F) { RETURN (false); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1754 |
RETURN (true); |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1755 |
|
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1756 |
case 0xFE: |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1757 |
if (val <= 0xFE1f) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1758 |
if (val <= 0xFE6F) { RETURN (false); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1759 |
if (val <= 0xFEFE) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1760 |
RETURN (false); |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1761 |
|
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1762 |
case 0xFF: |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1763 |
if (val <= 0xFF20) { RETURN (false); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1764 |
if (val <= 0xFF3a) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1765 |
if (val <= 0xFF40) { RETURN (false); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1766 |
if (val <= 0xFF5a) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1767 |
if (val <= 0xFF65) { RETURN (false); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1768 |
if (val <= 0xFFdC) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1769 |
RETURN (false); |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1770 |
|
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1771 |
case 0x103: |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1772 |
if (val <= 0x1031f) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1773 |
if (val <= 0x1032F) { RETURN (false); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1774 |
if (val <= 0x10349) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1775 |
RETURN (false); |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1776 |
|
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1777 |
case 0x104: |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1778 |
RETURN (true); |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1779 |
|
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1780 |
case 0x1D4: |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1781 |
case 0x1D5: |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1782 |
RETURN (true); |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1783 |
|
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1784 |
case 0x1D6: |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1785 |
if (val == 0x1d6c1) { RETURN (false); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1786 |
if (val == 0x1d6db) { RETURN (false); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1787 |
if (val == 0x1d6fb) { RETURN (false); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1788 |
RETURN (true); |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1789 |
} |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1790 |
RETURN (false); |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1791 |
%} |
699 | 1792 |
! ! |
1793 |
||
1794 |
!Character methodsFor:'printing & storing'! |
|
1795 |
||
1796 |
displayString |
|
1797 |
"return a string used when the receiver is to be displayed |
|
1798 |
in an inspector kind-of-thing" |
|
1799 |
||
2908 | 1800 |
^ (self storeString , ' "16r' , (asciivalue printStringRadix:16) , '"') |
699 | 1801 |
! |
1802 |
||
1803 |
isLiteral |
|
4655
b9405ca0bb4e
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4340
diff
changeset
|
1804 |
"return true, if the receiver can be used as a literal constant in ST syntax |
699 | 1805 |
(i.e. can be used in constant arrays)" |
1806 |
||
1807 |
^ true |
|
1808 |
! |
|
1809 |
||
1810 |
||
5746
cf5e42cb72ef
do not overwrite the standard printing conventions
Claus Gittinger <cg@exept.de>
parents:
5566
diff
changeset
|
1811 |
"print myself on stdout. |
cf5e42cb72ef
do not overwrite the standard printing conventions
Claus Gittinger <cg@exept.de>
parents:
5566
diff
changeset
|
1812 |
This method does NOT (by purpose) use the stream classes and |
cf5e42cb72ef
do not overwrite the standard printing conventions
Claus Gittinger <cg@exept.de>
parents:
5566
diff
changeset
|
1813 |
will therefore work even in case of emergency (but only, if Stdout is nil)." |
699 | 1814 |
|
1815 |
%{ /* NOCONTEXT */ |
|
1816 |
||
5746
cf5e42cb72ef
do not overwrite the standard printing conventions
Claus Gittinger <cg@exept.de>
parents:
5566
diff
changeset
|
1817 |
if (@global(Stdout) == nil) { |
cf5e42cb72ef
do not overwrite the standard printing conventions
Claus Gittinger <cg@exept.de>
parents:
5566
diff
changeset
|
1818 |
putchar(__intVal(__INST(asciivalue))); |
cf5e42cb72ef
do not overwrite the standard printing conventions
Claus Gittinger <cg@exept.de>
parents:
5566
diff
changeset
|
1819 |
RETURN(self); |
cf5e42cb72ef
do not overwrite the standard printing conventions
Claus Gittinger <cg@exept.de>
parents:
5566
diff
changeset
|
1820 |
} |
5452
71fd110c347a
allow print, printCR during early initialization
Claus Gittinger <cg@exept.de>
parents:
5433
diff
changeset
|
1821 |
%}. |
71fd110c347a
allow print, printCR during early initialization
Claus Gittinger <cg@exept.de>
parents:
5433
diff
changeset
|
1822 |
super print |
699 | 1823 |
! |
1824 |
||
1825 |
printOn:aStream |
|
1826 |
"print myself on aStream" |
|
1827 |
||
1828 |
aStream nextPut:self |
|
1829 |
! |
|
1830 |
||
1831 |
printString |
|
1832 |
"return a string to print me" |
|
1833 |
||
1834 |
^ self asString |
|
1835 |
! |
|
1836 |
||
2214 | 1837 |
reconstructOn:aStream |
1838 |
aStream nextPut:$$; nextPut:self |
|
1839 |
||
1840 |
"Created: 6.2.1996 / 09:46:12 / stefan" |
|
1841 |
"Modified: 6.2.1996 / 10:57:35 / stefan" |
|
1842 |
! |
|
1843 |
||
699 | 1844 |
storeOn:aStream |
1845 |
"store myself on aStream" |
|
1846 |
||
1847 |
|special| |
|
1848 |
||
1849 |
(asciivalue between:33 and:127) ifFalse:[ |
|
4655
b9405ca0bb4e
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4340
diff
changeset
|
1850 |
(self == Character space) ifTrue:[ |
b9405ca0bb4e
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4340
diff
changeset
|
1851 |
special := 'space' |
b9405ca0bb4e
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4340
diff
changeset
|
1852 |
] ifFalse:[ |
b9405ca0bb4e
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4340
diff
changeset
|
1853 |
(self == Character cr) ifTrue:[ |
b9405ca0bb4e
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4340
diff
changeset
|
1854 |
special := 'cr'. |
b9405ca0bb4e
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4340
diff
changeset
|
1855 |
] ifFalse:[ |
b9405ca0bb4e
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4340
diff
changeset
|
1856 |
(self == Character tab) ifTrue:[ |
b9405ca0bb4e
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4340
diff
changeset
|
1857 |
special := 'tab'. |
b9405ca0bb4e
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4340
diff
changeset
|
1858 |
] ifFalse:[ |
b9405ca0bb4e
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4340
diff
changeset
|
1859 |
(self == Character esc) ifTrue:[ |
b9405ca0bb4e
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4340
diff
changeset
|
1860 |
special := 'esc'. |
b9405ca0bb4e
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4340
diff
changeset
|
1861 |
] |
b9405ca0bb4e
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4340
diff
changeset
|
1862 |
] |
b9405ca0bb4e
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4340
diff
changeset
|
1863 |
] |
b9405ca0bb4e
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4340
diff
changeset
|
1864 |
]. |
b9405ca0bb4e
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4340
diff
changeset
|
1865 |
special notNil ifTrue:[ |
b9405ca0bb4e
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4340
diff
changeset
|
1866 |
aStream nextPutAll:'(Character '; nextPutAll:special; nextPut:$). |
b9405ca0bb4e
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4340
diff
changeset
|
1867 |
^ self |
b9405ca0bb4e
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4340
diff
changeset
|
1868 |
]. |
b9405ca0bb4e
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4340
diff
changeset
|
1869 |
aStream nextPutAll:'(Character value:16r'. |
b9405ca0bb4e
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4340
diff
changeset
|
1870 |
asciivalue printOn:aStream base:16. |
b9405ca0bb4e
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4340
diff
changeset
|
1871 |
aStream nextPut:$) |
699 | 1872 |
] ifTrue:[ |
4655
b9405ca0bb4e
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4340
diff
changeset
|
1873 |
aStream nextPut:$$; nextPut:self |
699 | 1874 |
] |
995
b018368b3a94
asString to 16-bit char should return a twoByteString
Claus Gittinger <cg@exept.de>
parents:
819
diff
changeset
|
1875 |
|
3190
81ffb25d1d86
Use #printOn: instead of #printString
Stefan Vogel <sv@exept.de>
parents:
3072
diff
changeset
|
1876 |
"Modified: / 23.2.1996 / 23:27:32 / cg" |
81ffb25d1d86
Use #printOn: instead of #printString
Stefan Vogel <sv@exept.de>
parents:
3072
diff
changeset
|
1877 |
"Modified: / 20.1.1998 / 14:10:46 / stefan" |
699 | 1878 |
! ! |
1879 |
||
7257 | 1880 |
!Character methodsFor:'private-accessing'! |
699 | 1881 |
|
1882 |
setAsciiValue:anInteger |
|
7897 | 1883 |
"very private - set the asciivalue / codePoint. |
699 | 1884 |
- use this only for characters with codes > 16rFF. |
7897 | 1885 |
DANGER alert: |
1886 |
funny things happen, if this is applied to |
|
1887 |
one of the shared characters with codePoints 0..255." |
|
699 | 1888 |
|
1889 |
asciivalue := anInteger |
|
1890 |
! ! |
|
1891 |
||
8004
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1892 |
!Character methodsFor:'queries'! |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1893 |
|
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1894 |
bitsPerCharacter |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1895 |
"return the number of bits I require for storage" |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1896 |
|
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1897 |
asciivalue <= 16rFF ifTrue:[^ 8]. |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1898 |
asciivalue <= 16rFFFF ifTrue:[^ 16]. |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1899 |
^ 32 |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1900 |
! |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1901 |
|
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1902 |
stringSpecies |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1903 |
"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
|
1904 |
|
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1905 |
asciivalue <= 16rFF ifTrue:[^ String]. |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1906 |
asciivalue <= 16rFFFF ifTrue:[^ Unicode16String]. |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1907 |
^ Unicode32String |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1908 |
! ! |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1909 |
|
1 | 1910 |
!Character methodsFor:'testing'! |
1911 |
||
54 | 1912 |
isCharacter |
1913 |
"return true, if the receiver is some kind of character" |
|
1914 |
||
1915 |
^ true |
|
1916 |
! |
|
1917 |
||
3667 | 1918 |
isControlCharacter |
1919 |
"return true if I am a control character (i.e. ascii value < 32)" |
|
1920 |
||
1921 |
%{ /* NOCONTEXT */ |
|
1922 |
#ifdef NON_ASCII /* i.e. EBCDIC ;-) */ |
|
1923 |
not yet implemented - fails when compiled |
|
1924 |
#else |
|
1925 |
REGISTER int val; |
|
1926 |
||
1927 |
val = __intVal(__INST(asciivalue)); |
|
3881 | 1928 |
if (val < ' ') { |
5423
e33decc83182
non-primitive fallBack code added
Claus Gittinger <cg@exept.de>
parents:
5407
diff
changeset
|
1929 |
RETURN ( true ); |
3667 | 1930 |
} |
1931 |
#endif |
|
5423
e33decc83182
non-primitive fallBack code added
Claus Gittinger <cg@exept.de>
parents:
5407
diff
changeset
|
1932 |
RETURN (false); |
3667 | 1933 |
%}. |
5423
e33decc83182
non-primitive fallBack code added
Claus Gittinger <cg@exept.de>
parents:
5407
diff
changeset
|
1934 |
^ asciivalue < 16r20. |
3667 | 1935 |
|
1936 |
" |
|
1937 |
(Character value:1) isControlCharacter |
|
1938 |
$a isControlCharacter |
|
1939 |
" |
|
1940 |
! |
|
1941 |
||
1 | 1942 |
isDigit |
1943 |
"return true, if I am a digit (i.e. $0 .. $9)" |
|
1944 |
||
7980 | 1945 |
%{ /* NOCONTEXT */ |
6527 | 1946 |
|
1947 |
REGISTER int val; |
|
1948 |
||
1949 |
val = __intVal(__INST(asciivalue)); |
|
1950 |
if ((unsigned)(val - '0') <= ('9' - '0')) { |
|
1951 |
RETURN ( true ); |
|
1952 |
} |
|
1953 |
RETURN ( false ); |
|
1954 |
%}. |
|
1955 |
^ asciivalue between:$0 asciiValue and:$9 asciiValue |
|
1 | 1956 |
! |
1957 |
||
1958 |
isDigitRadix:r |
|
1959 |
"return true, if I am a digit of a base r number" |
|
1960 |
||
1961 |
(asciivalue < $0 asciiValue) ifTrue:[^ false]. |
|
1962 |
(r > 10) ifTrue:[ |
|
6527 | 1963 |
(asciivalue <= $9 asciiValue) ifTrue:[ |
1964 |
^ true |
|
1965 |
]. |
|
1966 |
((asciivalue - $a asciiValue) between:0 and:(r - 11)) ifTrue:[ |
|
1967 |
^ true |
|
1968 |
]. |
|
1969 |
^ (asciivalue - $A asciiValue) between:0 and:(r - 11) |
|
1 | 1970 |
]. |
1971 |
(asciivalue - $0 asciiValue) < r ifTrue:[^ true]. |
|
1972 |
^ false |
|
1973 |
! |
|
1974 |
||
699 | 1975 |
isEndOfLineCharacter |
1976 |
"return true if I am a line delimitting character" |
|
1 | 1977 |
|
1978 |
%{ /* NOCONTEXT */ |
|
1979 |
||
1980 |
REGISTER int val; |
|
1981 |
||
1133 | 1982 |
val = __intVal(__INST(asciivalue)); |
699 | 1983 |
if ((val == '\n') |
1984 |
|| (val == '\r') |
|
1985 |
|| (val == '\f')) { |
|
5423
e33decc83182
non-primitive fallBack code added
Claus Gittinger <cg@exept.de>
parents:
5407
diff
changeset
|
1986 |
RETURN ( true ); |
54 | 1987 |
} |
5423
e33decc83182
non-primitive fallBack code added
Claus Gittinger <cg@exept.de>
parents:
5407
diff
changeset
|
1988 |
RETURN (false); |
e33decc83182
non-primitive fallBack code added
Claus Gittinger <cg@exept.de>
parents:
5407
diff
changeset
|
1989 |
%}. |
e33decc83182
non-primitive fallBack code added
Claus Gittinger <cg@exept.de>
parents:
5407
diff
changeset
|
1990 |
^ asciivalue == 16r0A |
e33decc83182
non-primitive fallBack code added
Claus Gittinger <cg@exept.de>
parents:
5407
diff
changeset
|
1991 |
or:[asciivalue == 16r0D |
e33decc83182
non-primitive fallBack code added
Claus Gittinger <cg@exept.de>
parents:
5407
diff
changeset
|
1992 |
or:[asciivalue == 16r0C]] |
e33decc83182
non-primitive fallBack code added
Claus Gittinger <cg@exept.de>
parents:
5407
diff
changeset
|
1993 |
|
1 | 1994 |
! |
1995 |
||
5473
c48d8c45c740
isImmediate returns true for shared characters
Claus Gittinger <cg@exept.de>
parents:
5471
diff
changeset
|
1996 |
isImmediate |
c48d8c45c740
isImmediate returns true for shared characters
Claus Gittinger <cg@exept.de>
parents:
5471
diff
changeset
|
1997 |
"return true if I am an immediate object |
c48d8c45c740
isImmediate returns true for shared characters
Claus Gittinger <cg@exept.de>
parents:
5471
diff
changeset
|
1998 |
i.e. I am represented in the pointer itself and |
c48d8c45c740
isImmediate returns true for shared characters
Claus Gittinger <cg@exept.de>
parents:
5471
diff
changeset
|
1999 |
no real object header/storage is used me. |
c48d8c45c740
isImmediate returns true for shared characters
Claus Gittinger <cg@exept.de>
parents:
5471
diff
changeset
|
2000 |
For VW compatibility, shared characters (i.e. in the range 0..255) |
c48d8c45c740
isImmediate returns true for shared characters
Claus Gittinger <cg@exept.de>
parents:
5471
diff
changeset
|
2001 |
also return true here" |
c48d8c45c740
isImmediate returns true for shared characters
Claus Gittinger <cg@exept.de>
parents:
5471
diff
changeset
|
2002 |
|
c48d8c45c740
isImmediate returns true for shared characters
Claus Gittinger <cg@exept.de>
parents:
5471
diff
changeset
|
2003 |
^ asciivalue <= 255 |
c48d8c45c740
isImmediate returns true for shared characters
Claus Gittinger <cg@exept.de>
parents:
5471
diff
changeset
|
2004 |
|
c48d8c45c740
isImmediate returns true for shared characters
Claus Gittinger <cg@exept.de>
parents:
5471
diff
changeset
|
2005 |
! |
c48d8c45c740
isImmediate returns true for shared characters
Claus Gittinger <cg@exept.de>
parents:
5471
diff
changeset
|
2006 |
|
1 | 2007 |
isLetter |
7979
7515722ccfb1
isUppercase / isLowercase fix for division character.
Claus Gittinger <cg@exept.de>
parents:
7976
diff
changeset
|
2008 |
"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
|
2009 |
Use isNationalLetter, if you are interested in those." |
1 | 2010 |
|
7980 | 2011 |
%{ /* NOCONTEXT */ |
1 | 2012 |
|
2013 |
REGISTER int val; |
|
2014 |
||
1133 | 2015 |
val = __intVal(__INST(asciivalue)); |
6527 | 2016 |
if ((unsigned)(val - 'a') <= ('z' - 'a')) { |
2017 |
RETURN ( true ); |
|
2018 |
} |
|
2019 |
if ((unsigned)(val - 'A') <= ('Z' - 'A')) { |
|
2020 |
RETURN ( true ); |
|
2021 |
} |
|
2022 |
RETURN ( false ); |
|
5423
e33decc83182
non-primitive fallBack code added
Claus Gittinger <cg@exept.de>
parents:
5407
diff
changeset
|
2023 |
%}. |
e33decc83182
non-primitive fallBack code added
Claus Gittinger <cg@exept.de>
parents:
5407
diff
changeset
|
2024 |
^ (asciivalue between:($a asciiValue) and:($z asciiValue)) |
e33decc83182
non-primitive fallBack code added
Claus Gittinger <cg@exept.de>
parents:
5407
diff
changeset
|
2025 |
or:[(asciivalue between:($A asciiValue) and:($Z asciiValue))] |
1 | 2026 |
! |
2027 |
||
154 | 2028 |
isLetterOrDigit |
7979
7515722ccfb1
isUppercase / isLowercase fix for division character.
Claus Gittinger <cg@exept.de>
parents:
7976
diff
changeset
|
2029 |
"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
|
2030 |
Use isNationalAlphaNumeric, if you are interested in those." |
1 | 2031 |
|
2032 |
%{ /* NOCONTEXT */ |
|
2033 |
||
2034 |
REGISTER int val; |
|
2035 |
||
1133 | 2036 |
val = __intVal(__INST(asciivalue)); |
6527 | 2037 |
if ((unsigned)(val - 'a') <= ('z' - 'a')) { |
5423
e33decc83182
non-primitive fallBack code added
Claus Gittinger <cg@exept.de>
parents:
5407
diff
changeset
|
2038 |
RETURN ( true ); |
1 | 2039 |
} |
6527 | 2040 |
if ((unsigned)(val - 'A') <= ('Z' - 'A')) { |
5423
e33decc83182
non-primitive fallBack code added
Claus Gittinger <cg@exept.de>
parents:
5407
diff
changeset
|
2041 |
RETURN ( true ); |
1 | 2042 |
} |
6527 | 2043 |
if ((unsigned)(val - '0') <= ('9' - '0')) { |
5423
e33decc83182
non-primitive fallBack code added
Claus Gittinger <cg@exept.de>
parents:
5407
diff
changeset
|
2044 |
RETURN ( true ); |
1 | 2045 |
} |
2046 |
RETURN ( false ); |
|
5423
e33decc83182
non-primitive fallBack code added
Claus Gittinger <cg@exept.de>
parents:
5407
diff
changeset
|
2047 |
%}. |
e33decc83182
non-primitive fallBack code added
Claus Gittinger <cg@exept.de>
parents:
5407
diff
changeset
|
2048 |
^ self isLetter or:[self isDigit] |
1 | 2049 |
! |
2050 |
||
699 | 2051 |
isLowercase |
7979
7515722ccfb1
isUppercase / isLowercase fix for division character.
Claus Gittinger <cg@exept.de>
parents:
7976
diff
changeset
|
2052 |
"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
|
2053 |
This one does care for national characters. |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2054 |
Caveat: |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2055 |
only returns the correct value for codes up to u+1d6ff (Unicode3.1). |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2056 |
(which is more than mozilla does, btw. ;-)" |
699 | 2057 |
|
2058 |
%{ /* NOCONTEXT */ |
|
2059 |
||
2060 |
REGISTER int val; |
|
7989
7907420b2fab
asUppercase / asLowercase for U0100..U04FF
Claus Gittinger <cg@exept.de>
parents:
7988
diff
changeset
|
2061 |
#define TRUE_IF_ODD(x) ((x & 1) ? true : false) |
7907420b2fab
asUppercase / asLowercase for U0100..U04FF
Claus Gittinger <cg@exept.de>
parents:
7988
diff
changeset
|
2062 |
#define TRUE_IF_EVEN(x) ((x & 1) ? false : true) |
154 | 2063 |
|
1133 | 2064 |
val = __intVal(__INST(asciivalue)); |
7989
7907420b2fab
asUppercase / asLowercase for U0100..U04FF
Claus Gittinger <cg@exept.de>
parents:
7988
diff
changeset
|
2065 |
switch (val >> 8) { |
7907420b2fab
asUppercase / asLowercase for U0100..U04FF
Claus Gittinger <cg@exept.de>
parents:
7988
diff
changeset
|
2066 |
case 0x00: |
7907420b2fab
asUppercase / asLowercase for U0100..U04FF
Claus Gittinger <cg@exept.de>
parents:
7988
diff
changeset
|
2067 |
if ((unsigned)(val - 'a') <= ('z' - 'a')) { |
7907420b2fab
asUppercase / asLowercase for U0100..U04FF
Claus Gittinger <cg@exept.de>
parents:
7988
diff
changeset
|
2068 |
RETURN ( true ); |
7907420b2fab
asUppercase / asLowercase for U0100..U04FF
Claus Gittinger <cg@exept.de>
parents:
7988
diff
changeset
|
2069 |
} |
7907420b2fab
asUppercase / asLowercase for U0100..U04FF
Claus Gittinger <cg@exept.de>
parents:
7988
diff
changeset
|
2070 |
|
7907420b2fab
asUppercase / asLowercase for U0100..U04FF
Claus Gittinger <cg@exept.de>
parents:
7988
diff
changeset
|
2071 |
/* iso8859 puts national lower case characters at e0 .. ff */ |
8010 | 2072 |
if ((val >= 0xDF) && (val <= 0xFF)) { |
2073 |
if (val != 0xF7) { |
|
7989
7907420b2fab
asUppercase / asLowercase for U0100..U04FF
Claus Gittinger <cg@exept.de>
parents:
7988
diff
changeset
|
2074 |
RETURN(true); |
7907420b2fab
asUppercase / asLowercase for U0100..U04FF
Claus Gittinger <cg@exept.de>
parents:
7988
diff
changeset
|
2075 |
} |
7907420b2fab
asUppercase / asLowercase for U0100..U04FF
Claus Gittinger <cg@exept.de>
parents:
7988
diff
changeset
|
2076 |
} |
8022
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2077 |
if (val == 0xAA) RETURN(true); /* FEMININE ORDINAL INDICATOR (high a-underline) */ |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2078 |
if (val == 0xB5) RETURN(true); /* MICRO SIGN */ |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2079 |
if (val == 0xBA) RETURN(true); /* MASCULINE ORDINAL INDICATOR (high o-underline) */ |
7989
7907420b2fab
asUppercase / asLowercase for U0100..U04FF
Claus Gittinger <cg@exept.de>
parents:
7988
diff
changeset
|
2080 |
RETURN (false); |
7979
7515722ccfb1
isUppercase / isLowercase fix for division character.
Claus Gittinger <cg@exept.de>
parents:
7976
diff
changeset
|
2081 |
|
7989
7907420b2fab
asUppercase / asLowercase for U0100..U04FF
Claus Gittinger <cg@exept.de>
parents:
7988
diff
changeset
|
2082 |
case 0x01: |
7907420b2fab
asUppercase / asLowercase for U0100..U04FF
Claus Gittinger <cg@exept.de>
parents:
7988
diff
changeset
|
2083 |
if (val <= 0x0137) { RETURN (TRUE_IF_ODD(val)); } |
7907420b2fab
asUppercase / asLowercase for U0100..U04FF
Claus Gittinger <cg@exept.de>
parents:
7988
diff
changeset
|
2084 |
if (val <= 0x0148) { RETURN (TRUE_IF_EVEN(val)); } |
7907420b2fab
asUppercase / asLowercase for U0100..U04FF
Claus Gittinger <cg@exept.de>
parents:
7988
diff
changeset
|
2085 |
if (val <= 0x0178) { RETURN (TRUE_IF_ODD(val)); } |
7907420b2fab
asUppercase / asLowercase for U0100..U04FF
Claus Gittinger <cg@exept.de>
parents:
7988
diff
changeset
|
2086 |
if (val <= 0x017E) { RETURN (TRUE_IF_EVEN(val)); } |
8022
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2087 |
if (val <= 0x0180) { RETURN (true); } |
7989
7907420b2fab
asUppercase / asLowercase for U0100..U04FF
Claus Gittinger <cg@exept.de>
parents:
7988
diff
changeset
|
2088 |
if (val < 0x01CD) { |
8022
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2089 |
if (val == 0x0181) { RETURN (false); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2090 |
if (val <= 0x0185) { |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2091 |
RETURN (TRUE_IF_ODD(val)); |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2092 |
} |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2093 |
if (val == 0x0188) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2094 |
if (val == 0x018C) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2095 |
if (val == 0x018D) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2096 |
if (val == 0x0192) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2097 |
if (val == 0x0195) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2098 |
if (val == 0x0199) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2099 |
if (val == 0x019A) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2100 |
if (val == 0x019B) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2101 |
if (val == 0x019E) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2102 |
if (val <= 0x01A0) { RETURN (false); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2103 |
if (val <= 0x01A6) { RETURN (TRUE_IF_ODD(val)); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2104 |
if (val <= 0x01AA) { RETURN (TRUE_IF_EVEN(val)); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2105 |
if (val <= 0x01AE) { RETURN (TRUE_IF_ODD(val)); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2106 |
if (val == 0x01B2) { RETURN (false); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2107 |
if (val <= 0x01B6) { RETURN (TRUE_IF_EVEN(val)); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2108 |
if (val == 0x01B9) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2109 |
if (val == 0x01BA) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2110 |
if (val == 0x01BD) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2111 |
if (val == 0x01BE) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2112 |
if (val == 0x01BF) { RETURN (true); } |
7989
7907420b2fab
asUppercase / asLowercase for U0100..U04FF
Claus Gittinger <cg@exept.de>
parents:
7988
diff
changeset
|
2113 |
if (val == 0x01C6) { RETURN (true); } |
7907420b2fab
asUppercase / asLowercase for U0100..U04FF
Claus Gittinger <cg@exept.de>
parents:
7988
diff
changeset
|
2114 |
if (val == 0x01C9) { RETURN (true); } |
7907420b2fab
asUppercase / asLowercase for U0100..U04FF
Claus Gittinger <cg@exept.de>
parents:
7988
diff
changeset
|
2115 |
if (val == 0x01CC) { RETURN (true); } |
7907420b2fab
asUppercase / asLowercase for U0100..U04FF
Claus Gittinger <cg@exept.de>
parents:
7988
diff
changeset
|
2116 |
RETURN (false); |
7907420b2fab
asUppercase / asLowercase for U0100..U04FF
Claus Gittinger <cg@exept.de>
parents:
7988
diff
changeset
|
2117 |
} |
7907420b2fab
asUppercase / asLowercase for U0100..U04FF
Claus Gittinger <cg@exept.de>
parents:
7988
diff
changeset
|
2118 |
if (val <= 0x01DC) { RETURN (TRUE_IF_EVEN(val)); } |
7907420b2fab
asUppercase / asLowercase for U0100..U04FF
Claus Gittinger <cg@exept.de>
parents:
7988
diff
changeset
|
2119 |
if (val <= 0x01EF) { RETURN (TRUE_IF_ODD(val)); } |
7907420b2fab
asUppercase / asLowercase for U0100..U04FF
Claus Gittinger <cg@exept.de>
parents:
7988
diff
changeset
|
2120 |
if (val == 0x01F0) { RETURN (true); } |
7907420b2fab
asUppercase / asLowercase for U0100..U04FF
Claus Gittinger <cg@exept.de>
parents:
7988
diff
changeset
|
2121 |
if (val == 0x01F1) { RETURN (false); } |
7907420b2fab
asUppercase / asLowercase for U0100..U04FF
Claus Gittinger <cg@exept.de>
parents:
7988
diff
changeset
|
2122 |
if (val == 0x01F2) { RETURN (false); } |
7907420b2fab
asUppercase / asLowercase for U0100..U04FF
Claus Gittinger <cg@exept.de>
parents:
7988
diff
changeset
|
2123 |
if (val == 0x01F3) { RETURN (true); } |
7907420b2fab
asUppercase / asLowercase for U0100..U04FF
Claus Gittinger <cg@exept.de>
parents:
7988
diff
changeset
|
2124 |
if (val <= 0x01F6) { RETURN (TRUE_IF_ODD(val)); } |
7907420b2fab
asUppercase / asLowercase for U0100..U04FF
Claus Gittinger <cg@exept.de>
parents:
7988
diff
changeset
|
2125 |
if (val == 0x01F7) { RETURN (false); } |
7907420b2fab
asUppercase / asLowercase for U0100..U04FF
Claus Gittinger <cg@exept.de>
parents:
7988
diff
changeset
|
2126 |
RETURN (TRUE_IF_ODD(val)); |
7907420b2fab
asUppercase / asLowercase for U0100..U04FF
Claus Gittinger <cg@exept.de>
parents:
7988
diff
changeset
|
2127 |
|
7907420b2fab
asUppercase / asLowercase for U0100..U04FF
Claus Gittinger <cg@exept.de>
parents:
7988
diff
changeset
|
2128 |
case 0x02: |
7907420b2fab
asUppercase / asLowercase for U0100..U04FF
Claus Gittinger <cg@exept.de>
parents:
7988
diff
changeset
|
2129 |
if (val <= 0x0233) { RETURN (TRUE_IF_ODD(val)); } |
7907420b2fab
asUppercase / asLowercase for U0100..U04FF
Claus Gittinger <cg@exept.de>
parents:
7988
diff
changeset
|
2130 |
if (val <= 0x0236) { RETURN (true); } |
7907420b2fab
asUppercase / asLowercase for U0100..U04FF
Claus Gittinger <cg@exept.de>
parents:
7988
diff
changeset
|
2131 |
if (val < 0x0250) { RETURN (false); } |
7907420b2fab
asUppercase / asLowercase for U0100..U04FF
Claus Gittinger <cg@exept.de>
parents:
7988
diff
changeset
|
2132 |
if (val < 0x02B0) { RETURN (true); } |
7907420b2fab
asUppercase / asLowercase for U0100..U04FF
Claus Gittinger <cg@exept.de>
parents:
7988
diff
changeset
|
2133 |
RETURN (false); |
7907420b2fab
asUppercase / asLowercase for U0100..U04FF
Claus Gittinger <cg@exept.de>
parents:
7988
diff
changeset
|
2134 |
|
7907420b2fab
asUppercase / asLowercase for U0100..U04FF
Claus Gittinger <cg@exept.de>
parents:
7988
diff
changeset
|
2135 |
|
7907420b2fab
asUppercase / asLowercase for U0100..U04FF
Claus Gittinger <cg@exept.de>
parents:
7988
diff
changeset
|
2136 |
case 0x03: |
8022
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2137 |
if (val == 0x0390) { RETURN (true); } |
7989
7907420b2fab
asUppercase / asLowercase for U0100..U04FF
Claus Gittinger <cg@exept.de>
parents:
7988
diff
changeset
|
2138 |
if (val <= 0x03AB) { RETURN (false); } |
7907420b2fab
asUppercase / asLowercase for U0100..U04FF
Claus Gittinger <cg@exept.de>
parents:
7988
diff
changeset
|
2139 |
if (val <= 0x03D1) { RETURN (true); } |
8022
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2140 |
if (val == 0x03D5) { RETURN (true); } |
7989
7907420b2fab
asUppercase / asLowercase for U0100..U04FF
Claus Gittinger <cg@exept.de>
parents:
7988
diff
changeset
|
2141 |
if (val == 0x03D6) { RETURN (true); } |
8022
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2142 |
if (val < 0x03D7) { RETURN (false); } |
7989
7907420b2fab
asUppercase / asLowercase for U0100..U04FF
Claus Gittinger <cg@exept.de>
parents:
7988
diff
changeset
|
2143 |
if (val <= 0x03EF) { RETURN (TRUE_IF_ODD(val)); } |
8022
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2144 |
if (val <= 0x03F3) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2145 |
if (val == 0x03F5) { RETURN (true); } |
7989
7907420b2fab
asUppercase / asLowercase for U0100..U04FF
Claus Gittinger <cg@exept.de>
parents:
7988
diff
changeset
|
2146 |
RETURN (false); |
7907420b2fab
asUppercase / asLowercase for U0100..U04FF
Claus Gittinger <cg@exept.de>
parents:
7988
diff
changeset
|
2147 |
|
7907420b2fab
asUppercase / asLowercase for U0100..U04FF
Claus Gittinger <cg@exept.de>
parents:
7988
diff
changeset
|
2148 |
case 0x04: |
7907420b2fab
asUppercase / asLowercase for U0100..U04FF
Claus Gittinger <cg@exept.de>
parents:
7988
diff
changeset
|
2149 |
if (val <= 0x042F) { RETURN (false); } |
7907420b2fab
asUppercase / asLowercase for U0100..U04FF
Claus Gittinger <cg@exept.de>
parents:
7988
diff
changeset
|
2150 |
if (val <= 0x045F) { RETURN (true); } |
7907420b2fab
asUppercase / asLowercase for U0100..U04FF
Claus Gittinger <cg@exept.de>
parents:
7988
diff
changeset
|
2151 |
if (val <= 0x0481) { RETURN (TRUE_IF_ODD(val)); } |
7907420b2fab
asUppercase / asLowercase for U0100..U04FF
Claus Gittinger <cg@exept.de>
parents:
7988
diff
changeset
|
2152 |
if (val < 0x048A) { RETURN (false); } |
8022
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2153 |
if (val <= 0x04C0) { RETURN (TRUE_IF_ODD(val)); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2154 |
if (val == 0x04C5) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2155 |
if (val <= 0x04C8) { RETURN (TRUE_IF_EVEN(val)); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2156 |
if (val == 0x04CB) { RETURN (false); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2157 |
if (val == 0x04CC) { RETURN (true); } |
7989
7907420b2fab
asUppercase / asLowercase for U0100..U04FF
Claus Gittinger <cg@exept.de>
parents:
7988
diff
changeset
|
2158 |
RETURN (TRUE_IF_ODD(val)); |
7907420b2fab
asUppercase / asLowercase for U0100..U04FF
Claus Gittinger <cg@exept.de>
parents:
7988
diff
changeset
|
2159 |
|
7907420b2fab
asUppercase / asLowercase for U0100..U04FF
Claus Gittinger <cg@exept.de>
parents:
7988
diff
changeset
|
2160 |
case 0x05: |
7907420b2fab
asUppercase / asLowercase for U0100..U04FF
Claus Gittinger <cg@exept.de>
parents:
7988
diff
changeset
|
2161 |
if (val <= 0x050F) { RETURN (TRUE_IF_ODD(val)); } |
7907420b2fab
asUppercase / asLowercase for U0100..U04FF
Claus Gittinger <cg@exept.de>
parents:
7988
diff
changeset
|
2162 |
if (val < 0x0561) { RETURN (false); } |
8022
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2163 |
if (val <= 0x0587) { RETURN (true); } |
7989
7907420b2fab
asUppercase / asLowercase for U0100..U04FF
Claus Gittinger <cg@exept.de>
parents:
7988
diff
changeset
|
2164 |
RETURN (false); |
7990
2f78c1d609c7
asUppercase / asLowercase for UFF00..UFFFF
Claus Gittinger <cg@exept.de>
parents:
7989
diff
changeset
|
2165 |
|
8022
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2166 |
case 0x1E: |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2167 |
if (val < 0x1E96) { RETURN (TRUE_IF_ODD(val)); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2168 |
if (val <= 0x1E9F) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2169 |
RETURN (TRUE_IF_ODD(val)); |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2170 |
|
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2171 |
case 0x1F: |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2172 |
if (val <= 0x1F6F) { |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2173 |
if (val & 0x0008) { RETURN (false); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2174 |
RETURN (true); |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2175 |
} |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2176 |
if (val <= 0x1F87) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2177 |
if (val < 0x1FB8) { |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2178 |
if (val & 0x0008) { RETURN (false); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2179 |
RETURN (true); |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2180 |
} |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2181 |
if (val == 0x1FBE) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2182 |
if (val == 0x1FD4) { RETURN (false); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2183 |
if (val == 0x1FC5) { RETURN (false); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2184 |
if (val == 0x1FD5) { RETURN (false); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2185 |
if (val == 0x1FC1) { RETURN (false); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2186 |
if (val == 0x1FF1) { RETURN (false); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2187 |
if (val == 0x1FC0) { RETURN (false); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2188 |
if (val == 0x1FF0) { RETURN (false); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2189 |
if (((val & 0x000F) >= 0x0000) && ((val & 0x000F) <= 0x0007)) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2190 |
RETURN (false); |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2191 |
|
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2192 |
case 0x20: |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2193 |
if (val == 0x207F) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2194 |
RETURN (false); |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2195 |
|
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2196 |
case 0x21: |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2197 |
if (val == 0x210A) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2198 |
if (val < 0x210E) { RETURN (false); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2199 |
if (val <= 0x210F) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2200 |
if (val == 0x2113) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2201 |
if (val == 0x212F) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2202 |
if (val == 0x2134) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2203 |
if (val == 0x2139) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2204 |
RETURN (false); |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2205 |
|
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2206 |
case 0xFB: |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2207 |
if (val <= 0xFB1C) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2208 |
RETURN (false); |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2209 |
|
7990
2f78c1d609c7
asUppercase / asLowercase for UFF00..UFFFF
Claus Gittinger <cg@exept.de>
parents:
7989
diff
changeset
|
2210 |
case 0xFF: |
2f78c1d609c7
asUppercase / asLowercase for UFF00..UFFFF
Claus Gittinger <cg@exept.de>
parents:
7989
diff
changeset
|
2211 |
if ((val >= 0xFF41) && (val <= 0xFF5A)) { RETURN (true); } |
2f78c1d609c7
asUppercase / asLowercase for UFF00..UFFFF
Claus Gittinger <cg@exept.de>
parents:
7989
diff
changeset
|
2212 |
RETURN (false); |
8022
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2213 |
|
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2214 |
case 0x104: |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2215 |
if (val <= 0x10427) { RETURN (false); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2216 |
if (val <= 0x1044D) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2217 |
RETURN (false); |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2218 |
|
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2219 |
case 0x1D4: |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2220 |
case 0x1D5: |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2221 |
case 0x1D6: |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2222 |
if (val <= 0x1D419) { RETURN (false); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2223 |
if (val < 0x1D6be) { |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2224 |
if (((val - 0x1D41A) % 52) <= 25) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2225 |
RETURN (false); |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2226 |
} |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2227 |
if (val < 0x1D6c2) { RETURN (false); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2228 |
if (val < 0x1D6db) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2229 |
if (val == 0x1D6db) { RETURN (false); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2230 |
if (val < 0x1D6e2) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2231 |
if (val <= 0x1D6fb) { RETURN (false); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2232 |
RETURN (true); |
699 | 2233 |
} |
7989
7907420b2fab
asUppercase / asLowercase for U0100..U04FF
Claus Gittinger <cg@exept.de>
parents:
7988
diff
changeset
|
2234 |
#undef TRUE_IF_ODD |
7907420b2fab
asUppercase / asLowercase for U0100..U04FF
Claus Gittinger <cg@exept.de>
parents:
7988
diff
changeset
|
2235 |
#undef TRUE_IF_EVEN |
7907420b2fab
asUppercase / asLowercase for U0100..U04FF
Claus Gittinger <cg@exept.de>
parents:
7988
diff
changeset
|
2236 |
RETURN (false); |
5423
e33decc83182
non-primitive fallBack code added
Claus Gittinger <cg@exept.de>
parents:
5407
diff
changeset
|
2237 |
%}. |
154 | 2238 |
! |
2239 |
||
699 | 2240 |
isPrintable |
2241 |
"return true, if the receiver is a useful printable character |
|
2242 |
(see fileBrowsers showFile:-method on how it can be used)" |
|
1 | 2243 |
|
699 | 2244 |
(asciivalue between:32 and:127) ifTrue:[^ true]. |
6398 | 2245 |
asciivalue == 12 ifTrue:[^ true]. "/ FF |
2246 |
asciivalue == 13 ifTrue:[^ true]. "/ CR |
|
2247 |
asciivalue == 9 ifTrue:[^ true]. "/ TAB |
|
2248 |
asciivalue == 10 ifTrue:[^ true]. "/ NL |
|
2840 | 2249 |
|
2250 |
(asciivalue between:16rA0 and:16rBF) ifTrue:[^ true]. "/ ISO8859 |
|
699 | 2251 |
^ self isNationalLetter |
2840 | 2252 |
|
2253 |
"Modified: 7.8.1997 / 17:05:24 / cg" |
|
1 | 2254 |
! |
2255 |
||
2256 |
isSeparator |
|
2257 |
"return true if I am a space, cr, tab, nl, or newPage" |
|
2258 |
||
2259 |
%{ /* NOCONTEXT */ |
|
2260 |
||
2261 |
REGISTER int val; |
|
2262 |
||
1133 | 2263 |
val = __intVal(__INST(asciivalue)); |
328 | 2264 |
#ifndef NON_ASCII /* i.e. EBCDIC ;-) */ |
2265 |
if (val <= ' ') |
|
2266 |
#endif |
|
5423
e33decc83182
non-primitive fallBack code added
Claus Gittinger <cg@exept.de>
parents:
5407
diff
changeset
|
2267 |
if ((val == ' ') |
e33decc83182
non-primitive fallBack code added
Claus Gittinger <cg@exept.de>
parents:
5407
diff
changeset
|
2268 |
|| (val == '\n') |
e33decc83182
non-primitive fallBack code added
Claus Gittinger <cg@exept.de>
parents:
5407
diff
changeset
|
2269 |
|| (val == '\t') |
e33decc83182
non-primitive fallBack code added
Claus Gittinger <cg@exept.de>
parents:
5407
diff
changeset
|
2270 |
|| (val == '\r') |
e33decc83182
non-primitive fallBack code added
Claus Gittinger <cg@exept.de>
parents:
5407
diff
changeset
|
2271 |
|| (val == '\f')) { |
e33decc83182
non-primitive fallBack code added
Claus Gittinger <cg@exept.de>
parents:
5407
diff
changeset
|
2272 |
RETURN ( true ); |
e33decc83182
non-primitive fallBack code added
Claus Gittinger <cg@exept.de>
parents:
5407
diff
changeset
|
2273 |
} |
e33decc83182
non-primitive fallBack code added
Claus Gittinger <cg@exept.de>
parents:
5407
diff
changeset
|
2274 |
RETURN (false); |
e33decc83182
non-primitive fallBack code added
Claus Gittinger <cg@exept.de>
parents:
5407
diff
changeset
|
2275 |
%}. |
e33decc83182
non-primitive fallBack code added
Claus Gittinger <cg@exept.de>
parents:
5407
diff
changeset
|
2276 |
^ (asciivalue == 16r20) |
e33decc83182
non-primitive fallBack code added
Claus Gittinger <cg@exept.de>
parents:
5407
diff
changeset
|
2277 |
or:[asciivalue == 16r0D |
e33decc83182
non-primitive fallBack code added
Claus Gittinger <cg@exept.de>
parents:
5407
diff
changeset
|
2278 |
or:[asciivalue == 16r0A |
e33decc83182
non-primitive fallBack code added
Claus Gittinger <cg@exept.de>
parents:
5407
diff
changeset
|
2279 |
or:[asciivalue == 16r09 |
e33decc83182
non-primitive fallBack code added
Claus Gittinger <cg@exept.de>
parents:
5407
diff
changeset
|
2280 |
or:[asciivalue == 16r0C]]]] |
e33decc83182
non-primitive fallBack code added
Claus Gittinger <cg@exept.de>
parents:
5407
diff
changeset
|
2281 |
|
1 | 2282 |
! |
2283 |
||
699 | 2284 |
isUppercase |
7979
7515722ccfb1
isUppercase / isLowercase fix for division character.
Claus Gittinger <cg@exept.de>
parents:
7976
diff
changeset
|
2285 |
"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
|
2286 |
This one does care for national characters. |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2287 |
Caveat: |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2288 |
only returns the correct value for codes up to u+1d6ff (Unicode3.1). |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2289 |
(which is more than mozilla does, btw. ;-)" |
1 | 2290 |
|
2291 |
%{ /* NOCONTEXT */ |
|
7988
cb1c920e67eb
isUppercase / isLowercase unicode changes
Claus Gittinger <cg@exept.de>
parents:
7987
diff
changeset
|
2292 |
#define TRUE_IF_ODD(x) ((x & 1) ? true : false) |
cb1c920e67eb
isUppercase / isLowercase unicode changes
Claus Gittinger <cg@exept.de>
parents:
7987
diff
changeset
|
2293 |
#define TRUE_IF_EVEN(x) ((x & 1) ? false : true) |
1 | 2294 |
|
2295 |
REGISTER int val; |
|
2296 |
||
1133 | 2297 |
val = __intVal(__INST(asciivalue)); |
7979
7515722ccfb1
isUppercase / isLowercase fix for division character.
Claus Gittinger <cg@exept.de>
parents:
7976
diff
changeset
|
2298 |
|
7988
cb1c920e67eb
isUppercase / isLowercase unicode changes
Claus Gittinger <cg@exept.de>
parents:
7987
diff
changeset
|
2299 |
switch (val >> 8) { |
cb1c920e67eb
isUppercase / isLowercase unicode changes
Claus Gittinger <cg@exept.de>
parents:
7987
diff
changeset
|
2300 |
case 0x00: |
cb1c920e67eb
isUppercase / isLowercase unicode changes
Claus Gittinger <cg@exept.de>
parents:
7987
diff
changeset
|
2301 |
if ((unsigned)(val - 'A') <= ('Z' - 'A')) { |
cb1c920e67eb
isUppercase / isLowercase unicode changes
Claus Gittinger <cg@exept.de>
parents:
7987
diff
changeset
|
2302 |
RETURN ( true ); |
cb1c920e67eb
isUppercase / isLowercase unicode changes
Claus Gittinger <cg@exept.de>
parents:
7987
diff
changeset
|
2303 |
} |
cb1c920e67eb
isUppercase / isLowercase unicode changes
Claus Gittinger <cg@exept.de>
parents:
7987
diff
changeset
|
2304 |
/* iso8859 puts national upper case characters at c0 .. df */ |
8010 | 2305 |
if ((val >= 0xC0) && (val <= 0xDE)) { |
7988
cb1c920e67eb
isUppercase / isLowercase unicode changes
Claus Gittinger <cg@exept.de>
parents:
7987
diff
changeset
|
2306 |
if (val != 0xD7) { |
cb1c920e67eb
isUppercase / isLowercase unicode changes
Claus Gittinger <cg@exept.de>
parents:
7987
diff
changeset
|
2307 |
RETURN(true); |
cb1c920e67eb
isUppercase / isLowercase unicode changes
Claus Gittinger <cg@exept.de>
parents:
7987
diff
changeset
|
2308 |
} |
cb1c920e67eb
isUppercase / isLowercase unicode changes
Claus Gittinger <cg@exept.de>
parents:
7987
diff
changeset
|
2309 |
} |
cb1c920e67eb
isUppercase / isLowercase unicode changes
Claus Gittinger <cg@exept.de>
parents:
7987
diff
changeset
|
2310 |
RETURN (false); |
7979
7515722ccfb1
isUppercase / isLowercase fix for division character.
Claus Gittinger <cg@exept.de>
parents:
7976
diff
changeset
|
2311 |
|
7988
cb1c920e67eb
isUppercase / isLowercase unicode changes
Claus Gittinger <cg@exept.de>
parents:
7987
diff
changeset
|
2312 |
case 0x01: |
cb1c920e67eb
isUppercase / isLowercase unicode changes
Claus Gittinger <cg@exept.de>
parents:
7987
diff
changeset
|
2313 |
if (val <= 0x0137) { RETURN (TRUE_IF_EVEN(val)); } |
cb1c920e67eb
isUppercase / isLowercase unicode changes
Claus Gittinger <cg@exept.de>
parents:
7987
diff
changeset
|
2314 |
if (val <= 0x0148) { RETURN (TRUE_IF_ODD(val)); } |
cb1c920e67eb
isUppercase / isLowercase unicode changes
Claus Gittinger <cg@exept.de>
parents:
7987
diff
changeset
|
2315 |
if (val <= 0x0178) { RETURN (TRUE_IF_EVEN(val)); } |
cb1c920e67eb
isUppercase / isLowercase unicode changes
Claus Gittinger <cg@exept.de>
parents:
7987
diff
changeset
|
2316 |
if (val <= 0x017E) { RETURN (TRUE_IF_ODD(val)); } |
cb1c920e67eb
isUppercase / isLowercase unicode changes
Claus Gittinger <cg@exept.de>
parents:
7987
diff
changeset
|
2317 |
if (val < 0x01CD) { |
8022
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2318 |
if (val == 0x0180) { RETURN (false); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2319 |
if (val == 0x0181) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2320 |
if (val <= 0x0186) { |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2321 |
RETURN (TRUE_IF_EVEN(val)); |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2322 |
} |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2323 |
if (val <= 0x0189) { |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2324 |
RETURN (TRUE_IF_ODD(val)); |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2325 |
} |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2326 |
if (val <= 0x018B) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2327 |
if (val <= 0x018D) { RETURN (false); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2328 |
if (val <= 0x0191) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2329 |
if (val == 0x0193) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2330 |
if (val == 0x0194) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2331 |
if (val == 0x0196) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2332 |
if (val == 0x0197) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2333 |
if (val == 0x0198) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2334 |
if (val == 0x019C) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2335 |
if (val == 0x019D) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2336 |
if (val == 0x019F) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2337 |
if (val < 0x01A0) { RETURN (false); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2338 |
if (val <= 0x01A6) { RETURN (TRUE_IF_EVEN(val)); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2339 |
if (val <= 0x01AA) { RETURN (TRUE_IF_ODD(val)); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2340 |
if (val <= 0x01AE) { RETURN (TRUE_IF_EVEN(val)); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2341 |
if (val == 0x01B2) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2342 |
if (val <= 0x01B7) { RETURN (TRUE_IF_ODD(val)); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2343 |
if (val == 0x01B8) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2344 |
if (val == 0x01BC) { RETURN (true); } |
7988
cb1c920e67eb
isUppercase / isLowercase unicode changes
Claus Gittinger <cg@exept.de>
parents:
7987
diff
changeset
|
2345 |
if (val == 0x01C4) { RETURN (true); } |
cb1c920e67eb
isUppercase / isLowercase unicode changes
Claus Gittinger <cg@exept.de>
parents:
7987
diff
changeset
|
2346 |
if (val == 0x01C7) { RETURN (true); } |
8022
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2347 |
// if (val == 0x01C8) { RETURN (true); } |
7988
cb1c920e67eb
isUppercase / isLowercase unicode changes
Claus Gittinger <cg@exept.de>
parents:
7987
diff
changeset
|
2348 |
if (val == 0x01CA) { RETURN (true); } |
8022
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2349 |
// if (val == 0x01CB) { RETURN (true); } |
7988
cb1c920e67eb
isUppercase / isLowercase unicode changes
Claus Gittinger <cg@exept.de>
parents:
7987
diff
changeset
|
2350 |
RETURN (false); /* WRONG !!! */ |
cb1c920e67eb
isUppercase / isLowercase unicode changes
Claus Gittinger <cg@exept.de>
parents:
7987
diff
changeset
|
2351 |
} |
cb1c920e67eb
isUppercase / isLowercase unicode changes
Claus Gittinger <cg@exept.de>
parents:
7987
diff
changeset
|
2352 |
if (val <= 0x01DC) { RETURN (TRUE_IF_ODD(val)); } |
cb1c920e67eb
isUppercase / isLowercase unicode changes
Claus Gittinger <cg@exept.de>
parents:
7987
diff
changeset
|
2353 |
if (val <= 0x01EF) { RETURN (TRUE_IF_EVEN(val)); } |
cb1c920e67eb
isUppercase / isLowercase unicode changes
Claus Gittinger <cg@exept.de>
parents:
7987
diff
changeset
|
2354 |
if (val == 0x01F0) { RETURN (false); } |
cb1c920e67eb
isUppercase / isLowercase unicode changes
Claus Gittinger <cg@exept.de>
parents:
7987
diff
changeset
|
2355 |
if (val == 0x01F1) { RETURN (true); } |
cb1c920e67eb
isUppercase / isLowercase unicode changes
Claus Gittinger <cg@exept.de>
parents:
7987
diff
changeset
|
2356 |
if (val == 0x01F2) { RETURN (false); } |
cb1c920e67eb
isUppercase / isLowercase unicode changes
Claus Gittinger <cg@exept.de>
parents:
7987
diff
changeset
|
2357 |
if (val == 0x01F3) { RETURN (false); } |
8022
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2358 |
if (val == 0x01F4) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2359 |
if (val == 0x01F5) { RETURN (false); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2360 |
if (val == 0x01F6) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2361 |
if (val == 0x01F7) { RETURN (true); } |
7988
cb1c920e67eb
isUppercase / isLowercase unicode changes
Claus Gittinger <cg@exept.de>
parents:
7987
diff
changeset
|
2362 |
RETURN (TRUE_IF_EVEN(val)); |
cb1c920e67eb
isUppercase / isLowercase unicode changes
Claus Gittinger <cg@exept.de>
parents:
7987
diff
changeset
|
2363 |
|
cb1c920e67eb
isUppercase / isLowercase unicode changes
Claus Gittinger <cg@exept.de>
parents:
7987
diff
changeset
|
2364 |
case 0x02: |
cb1c920e67eb
isUppercase / isLowercase unicode changes
Claus Gittinger <cg@exept.de>
parents:
7987
diff
changeset
|
2365 |
if (val <= 0x0233) { RETURN (TRUE_IF_EVEN(val)); } |
cb1c920e67eb
isUppercase / isLowercase unicode changes
Claus Gittinger <cg@exept.de>
parents:
7987
diff
changeset
|
2366 |
RETURN (false); |
cb1c920e67eb
isUppercase / isLowercase unicode changes
Claus Gittinger <cg@exept.de>
parents:
7987
diff
changeset
|
2367 |
|
cb1c920e67eb
isUppercase / isLowercase unicode changes
Claus Gittinger <cg@exept.de>
parents:
7987
diff
changeset
|
2368 |
case 0x03: |
cb1c920e67eb
isUppercase / isLowercase unicode changes
Claus Gittinger <cg@exept.de>
parents:
7987
diff
changeset
|
2369 |
if (val < 0x0386) { RETURN (false); } |
cb1c920e67eb
isUppercase / isLowercase unicode changes
Claus Gittinger <cg@exept.de>
parents:
7987
diff
changeset
|
2370 |
if (val == 0x0387) { RETURN (false); } |
8022
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2371 |
if (val == 0x0390) { RETURN (false); } |
7988
cb1c920e67eb
isUppercase / isLowercase unicode changes
Claus Gittinger <cg@exept.de>
parents:
7987
diff
changeset
|
2372 |
if (val <= 0x03AB) { RETURN (true); } |
cb1c920e67eb
isUppercase / isLowercase unicode changes
Claus Gittinger <cg@exept.de>
parents:
7987
diff
changeset
|
2373 |
if (val <= 0x03D1) { RETURN (false); } |
cb1c920e67eb
isUppercase / isLowercase unicode changes
Claus Gittinger <cg@exept.de>
parents:
7987
diff
changeset
|
2374 |
if (val <= 0x03D4) { RETURN (true); } |
cb1c920e67eb
isUppercase / isLowercase unicode changes
Claus Gittinger <cg@exept.de>
parents:
7987
diff
changeset
|
2375 |
if (val <= 0x03D7) { RETURN (false); } |
cb1c920e67eb
isUppercase / isLowercase unicode changes
Claus Gittinger <cg@exept.de>
parents:
7987
diff
changeset
|
2376 |
if (val <= 0x03EF) { RETURN (TRUE_IF_EVEN(val)); } |
8022
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2377 |
if (val == 0x03F4) { RETURN (true); } |
7988
cb1c920e67eb
isUppercase / isLowercase unicode changes
Claus Gittinger <cg@exept.de>
parents:
7987
diff
changeset
|
2378 |
RETURN (false); |
cb1c920e67eb
isUppercase / isLowercase unicode changes
Claus Gittinger <cg@exept.de>
parents:
7987
diff
changeset
|
2379 |
|
cb1c920e67eb
isUppercase / isLowercase unicode changes
Claus Gittinger <cg@exept.de>
parents:
7987
diff
changeset
|
2380 |
case 0x04: |
cb1c920e67eb
isUppercase / isLowercase unicode changes
Claus Gittinger <cg@exept.de>
parents:
7987
diff
changeset
|
2381 |
if (val <= 0x042F) { RETURN (true); } |
cb1c920e67eb
isUppercase / isLowercase unicode changes
Claus Gittinger <cg@exept.de>
parents:
7987
diff
changeset
|
2382 |
if (val <= 0x045F) { RETURN (false); } |
cb1c920e67eb
isUppercase / isLowercase unicode changes
Claus Gittinger <cg@exept.de>
parents:
7987
diff
changeset
|
2383 |
if (val <= 0x0481) { RETURN (TRUE_IF_EVEN(val)); } |
cb1c920e67eb
isUppercase / isLowercase unicode changes
Claus Gittinger <cg@exept.de>
parents:
7987
diff
changeset
|
2384 |
if (val < 0x048A) { RETURN (false); } |
8022
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2385 |
if (val <= 0x04C0) { RETURN (TRUE_IF_EVEN(val)); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2386 |
if (val == 0x04C5) { RETURN (false); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2387 |
if (val <= 0x04C8) { RETURN (TRUE_IF_ODD(val)); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2388 |
if (val == 0x04CB) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2389 |
if (val == 0x04CC) { RETURN (false); } |
7988
cb1c920e67eb
isUppercase / isLowercase unicode changes
Claus Gittinger <cg@exept.de>
parents:
7987
diff
changeset
|
2390 |
RETURN (TRUE_IF_EVEN(val)); |
cb1c920e67eb
isUppercase / isLowercase unicode changes
Claus Gittinger <cg@exept.de>
parents:
7987
diff
changeset
|
2391 |
|
cb1c920e67eb
isUppercase / isLowercase unicode changes
Claus Gittinger <cg@exept.de>
parents:
7987
diff
changeset
|
2392 |
case 0x05: |
cb1c920e67eb
isUppercase / isLowercase unicode changes
Claus Gittinger <cg@exept.de>
parents:
7987
diff
changeset
|
2393 |
if (val <= 0x050F) { RETURN (TRUE_IF_EVEN(val)); } |
cb1c920e67eb
isUppercase / isLowercase unicode changes
Claus Gittinger <cg@exept.de>
parents:
7987
diff
changeset
|
2394 |
if (val < 0x0531) { RETURN (false); } |
8022
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2395 |
if (val <= 0x0556) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2396 |
RETURN (false); |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2397 |
|
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2398 |
case 0x10: |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2399 |
if (val < 0x10A0) { RETURN (false); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2400 |
if (val <= 0x10CF) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2401 |
RETURN (false); |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2402 |
|
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2403 |
case 0x1E: |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2404 |
if (val < 0x1E96) { RETURN (TRUE_IF_EVEN(val)); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2405 |
if (val < 0x1EA0) { RETURN (false); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2406 |
RETURN (TRUE_IF_EVEN(val)); |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2407 |
|
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2408 |
case 0x1F: |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2409 |
if (val <= 0x1F6F) { |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2410 |
if (val & 0x0008) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2411 |
} |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2412 |
if (val <= 0x1F87) { RETURN (false); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2413 |
if (val < 0x1FB8) { RETURN (false); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2414 |
if (val < 0x1FBC) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2415 |
if (val == 0x1FEC) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2416 |
if (((val & 0x000F) >= 0x0008) && ((val & 0x000F) <= 0x000B)) { RETURN (true); } |
7988
cb1c920e67eb
isUppercase / isLowercase unicode changes
Claus Gittinger <cg@exept.de>
parents:
7987
diff
changeset
|
2417 |
RETURN (false); |
8022
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2418 |
|
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2419 |
case 0x21: |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2420 |
if (val == 0x2102) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2421 |
if (val == 0x2107) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2422 |
if (val < 0x210B) { RETURN (false); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2423 |
if (val < 0x210E) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2424 |
if (val == 0x2110) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2425 |
if (val == 0x2111) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2426 |
if (val == 0x2112) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2427 |
if (val == 0x2115) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2428 |
if (val == 0x2119) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2429 |
if (val == 0x211A) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2430 |
if (val == 0x211B) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2431 |
if (val == 0x211C) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2432 |
if (val == 0x211D) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2433 |
if (val < 0x2124) { RETURN (false); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2434 |
if (val <= 0x212A) { RETURN (TRUE_IF_EVEN(val)); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2435 |
if (val == 0x212B) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2436 |
if (val == 0x212C) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2437 |
if (val == 0x212D) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2438 |
if (val == 0x2130) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2439 |
if (val == 0x2131) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2440 |
if (val == 0x2133) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2441 |
RETURN (false); |
7990
2f78c1d609c7
asUppercase / asLowercase for UFF00..UFFFF
Claus Gittinger <cg@exept.de>
parents:
7989
diff
changeset
|
2442 |
|
2f78c1d609c7
asUppercase / asLowercase for UFF00..UFFFF
Claus Gittinger <cg@exept.de>
parents:
7989
diff
changeset
|
2443 |
case 0xFF: |
2f78c1d609c7
asUppercase / asLowercase for UFF00..UFFFF
Claus Gittinger <cg@exept.de>
parents:
7989
diff
changeset
|
2444 |
if ((val >= 0xFF21) && (val <= 0xFF3A)) { RETURN (true); } |
2f78c1d609c7
asUppercase / asLowercase for UFF00..UFFFF
Claus Gittinger <cg@exept.de>
parents:
7989
diff
changeset
|
2445 |
RETURN (false); |
8022
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2446 |
|
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2447 |
case 0x104: |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2448 |
if (val <= 0x10427) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2449 |
RETURN (false); |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2450 |
|
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2451 |
case 0x1D4: |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2452 |
case 0x1D5: |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2453 |
case 0x1D6: |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2454 |
if (val <= 0x1D419) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2455 |
if (val < 0x1D6be) { |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2456 |
if (((val - 0x1D41A) % 52) <= 25) { RETURN (false); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2457 |
RETURN (true); |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2458 |
} |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2459 |
if (val < 0x1D6c1) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2460 |
if (val < 0x1D6e2) { RETURN (false); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2461 |
if (val < 0x1D6fb) { RETURN (true); } |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2462 |
|
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2463 |
RETURN (false); |
7979
7515722ccfb1
isUppercase / isLowercase fix for division character.
Claus Gittinger <cg@exept.de>
parents:
7976
diff
changeset
|
2464 |
} |
7988
cb1c920e67eb
isUppercase / isLowercase unicode changes
Claus Gittinger <cg@exept.de>
parents:
7987
diff
changeset
|
2465 |
RETURN (false); |
7985 | 2466 |
|
7989
7907420b2fab
asUppercase / asLowercase for U0100..U04FF
Claus Gittinger <cg@exept.de>
parents:
7988
diff
changeset
|
2467 |
#undef TRUE_IF_ODD |
7907420b2fab
asUppercase / asLowercase for U0100..U04FF
Claus Gittinger <cg@exept.de>
parents:
7988
diff
changeset
|
2468 |
#undef TRUE_IF_EVEN |
7988
cb1c920e67eb
isUppercase / isLowercase unicode changes
Claus Gittinger <cg@exept.de>
parents:
7987
diff
changeset
|
2469 |
%} |
1 | 2470 |
! |
2471 |
||
699 | 2472 |
isVowel |
2473 |
"return true, if I am a vowel (lower- or uppercase)" |
|
333 | 2474 |
|
6066 | 2475 |
"/ I know the code is ugly; |
2476 |
"/ better code is: |
|
2477 |
"/ 'aeiou' includes:self asLowercase |
|
2478 |
"/ or: |
|
2479 |
"/ 'aeiouAEIOU' includes:self |
|
2480 |
"/ |
|
2481 |
"/ until I have a smart compiler, I use the shorter (codewise): |
|
2482 |
||
699 | 2483 |
(self == $a) ifTrue:[^ true]. |
2484 |
(self == $e) ifTrue:[^ true]. |
|
2485 |
(self == $i) ifTrue:[^ true]. |
|
2486 |
(self == $o) ifTrue:[^ true]. |
|
2487 |
(self == $u) ifTrue:[^ true]. |
|
2488 |
(self == $A) ifTrue:[^ true]. |
|
2489 |
(self == $E) ifTrue:[^ true]. |
|
2490 |
(self == $I) ifTrue:[^ true]. |
|
2491 |
(self == $O) ifTrue:[^ true]. |
|
2492 |
(self == $U) ifTrue:[^ true]. |
|
2493 |
^ false |
|
1 | 2494 |
! ! |
699 | 2495 |
|
4655
b9405ca0bb4e
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4340
diff
changeset
|
2496 |
!Character methodsFor:'tracing'! |
b9405ca0bb4e
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4340
diff
changeset
|
2497 |
|
4682 | 2498 |
traceInto:aRequestor level:level from:referrer |
4655
b9405ca0bb4e
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4340
diff
changeset
|
2499 |
"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
|
2500 |
|
4682 | 2501 |
^ aRequestor traceCharacter:self level:level from:referrer |
4655
b9405ca0bb4e
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4340
diff
changeset
|
2502 |
|
b9405ca0bb4e
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4340
diff
changeset
|
2503 |
! ! |
b9405ca0bb4e
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4340
diff
changeset
|
2504 |
|
2124 | 2505 |
!Character class methodsFor:'documentation'! |
699 | 2506 |
|
2507 |
version |
|
8029 | 2508 |
^ '$Header: /cvs/stx/stx/libbasic/Character.st,v 1.110 2004-03-01 21:36:04 cg Exp $' |
699 | 2509 |
! ! |