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