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