Unicode source code's size reduction: short field names, delete unicodenumtable.pas.

This commit is contained in:
inoussa 2022-03-24 18:01:38 +00:00 committed by Michael Van Canneyt
parent ee8c3ff3cf
commit 551f267670
23 changed files with 77124 additions and 260671 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -24,6 +24,30 @@
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. }
const
UC_NUMERIC_COUNT = 142;
UC_NUMERIC_ARRAY : array[0..(UC_NUMERIC_COUNT-1)] of Double = (
0 ,1 ,2 ,3 ,4 ,5 ,6 ,7 ,8 ,
9 ,0.25 ,0.5 ,0.75 ,0.0625 ,0.125 ,0.1875 ,16 ,
10 ,100 ,1000 ,0.00625 ,0.025 ,0.0375 ,0.05 ,0.1 ,
0.15 ,0.2 ,1.5 ,2.5 ,3.5 ,4.5 ,5.5 ,6.5 ,
7.5 ,8.5 ,-0.5 ,20 ,30 ,40 ,50 ,60 ,
70 ,80 ,90 ,10000 ,17 ,18 ,19 ,0.142857142857143 ,
0.111111111111111 ,0.333333333333333 ,0.666666666666667 ,0.4 ,0.6 ,0.8 ,0.166666666666667 ,0.833333333333333 ,
0.375 ,0.625 ,0.875 ,11 ,12 ,500 ,5000 ,50000 ,
100000 ,13 ,14 ,15 ,21 ,22 ,23 ,24 ,
25 ,26 ,27 ,28 ,29 ,31 ,32 ,33 ,
34 ,35 ,36 ,37 ,38 ,39 ,41 ,42 ,
43 ,44 ,45 ,46 ,47 ,48 ,49 ,200 ,
300 ,400 ,600 ,700 ,800 ,900 ,2000 ,3000 ,
4000 ,6000 ,7000 ,8000 ,9000 ,20000 ,30000 ,40000 ,
60000 ,70000 ,80000 ,90000 ,0.916666666666667 ,200000 ,300000 ,400000 ,
500000 ,600000 ,700000 ,800000 ,900000 ,0.0833333333333333 ,0.416666666666667 ,0.583333333333333 ,
0.003125 ,0.0125 ,0.015625 ,0.03125 ,0.046875 ,216000 ,432000 ,1000000 ,
100000000 ,10000000000 ,1000000000000 ,10000000 ,20000000
);
const
UC_TABLE_1 : array[0..255] of Byte = (
0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,
@ -724,70 +748,58 @@ const
const
UCO_TABLE_1 : array[0..1023] of Word = (
0,1,2,3,4,5,6,7,8,9,10,11,12,13,10,10,
10,14,10,10,10,10,10,10,10,10,15,16,12,12,12,12,
12,17,12,18,10,10,10,10,10,10,10,19,20,10,10,21,
10,10,10,22,23,24,25,26,27,28,29,30,31,32,33,10,
34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,
34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,
34,34,34,34,34,34,34,34,34,35,34,34,34,36,37,34,
34,34,34,38,34,34,34,34,34,34,39,10,10,10,40,10,
34,34,34,34,41,10,10,10,10,10,10,10,10,10,10,10,
10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
42,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,
43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,
43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,
43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,44,
43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,
43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,
43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,
43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,44
0,1,2,3,4,5,6,7,8,9,10,11,12,13,10,10,10,14,10,10,
10,10,10,10,10,10,15,16,12,12,12,12,12,17,12,18,10,10,10,10,
10,10,10,19,20,10,10,21,10,10,10,22,23,24,25,26,27,28,29,30,
31,32,33,10,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,
34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,
34,34,34,34,34,35,34,34,34,36,37,34,34,34,34,38,34,34,34,34,
34,34,39,10,10,10,40,10,34,34,34,34,41,10,10,10,10,10,10,10,
10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
10,10,10,10,10,10,10,10,10,10,10,10,42,10,10,10,10,10,10,10,
10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,43,43,43,43,
43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,
43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,
43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,44,
43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,
43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,
43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,
43,43,43,44
);
UCO_TABLE_2 : array[0..44] of array[0..31] of Word = (

View File

@ -221,10 +221,14 @@ type
TUInt24Rec = packed record
public
{$ifdef ENDIAN_LITTLE}
byte0, byte1, byte2 : Byte;
a, b, c : Byte;
{$else ENDIAN_LITTLE}
byte2, byte1, byte0 : Byte;
c, b, a : Byte;
{$endif ENDIAN_LITTLE}
public
property byte0 : Byte read a write a;
property byte1 : Byte read b write b;
property byte2 : Byte read c write c;
public
class operator Implicit(a : TUInt24Rec) : Cardinal;{$ifdef USE_INLINE}inline;{$ENDIF}
class operator Implicit(a : TUInt24Rec) : LongInt;{$ifdef USE_INLINE}inline;{$ENDIF}
@ -268,9 +272,9 @@ type
const
ZERO_UINT24 : UInt24 =
{$ifdef ENDIAN_LITTLE}
(byte0 : 0; byte1 : 0; byte2 : 0;);
(a : 0; b : 0; c : 0;);
{$else ENDIAN_LITTLE}
(byte2 : 0; byte1 : 0; byte0 : 0;);
(c : 0; b : 0; a : 0;);
{$endif ENDIAN_LITTLE}
type
@ -293,14 +297,19 @@ type
procedure SetHangulSyllable(AValue : Boolean);
function GetNumericValue: Double;inline;
function GetUnifiedIdeograph : Boolean;inline;
public //Shortned names
C : Byte; //CategoryData
C3 : Byte; //Canonical Combining Class
N : Byte; //NumericIndex
UC : UInt24; //SimpleUpperCase
LC : UInt24; //SimpleLowerCase
D : SmallInt; //DecompositionID
public
CategoryData : Byte;
public
CCC : Byte;
NumericIndex : Byte;
SimpleUpperCase : UInt24;
SimpleLowerCase : UInt24;
DecompositionID : SmallInt;
property CategoryData : Byte read C write C;
property NumericIndex : Byte read N write N;
property SimpleUpperCase : UInt24 read UC write UC;
property SimpleLowerCase : UInt24 read LC write LC;
property DecompositionID : SmallInt read D write D;
public
property Category : Byte read GetCategory write SetCategory;
property WhiteSpace : Boolean read GetWhiteSpace write SetWhiteSpace;
@ -621,8 +630,6 @@ resourcestring
SCollationNotFound = 'Collation not found : "%s".';
implementation
uses
unicodenumtable;
type
@ -1857,8 +1864,8 @@ var
pu : ^UInt24;
begin
pdecIdx := @(UC_DEC_BOOK_DATA.Index[AIndex]);
pu := @(UC_DEC_BOOK_DATA.CodePoints[pdecIdx^.StartPosition]);
kc := pdecIdx^.Length;
pu := @(UC_DEC_BOOK_DATA.CodePoints[pdecIdx^.S]);
kc := pdecIdx^.L;
Inc(pu,kc);
for k := 1 to kc do begin
Dec(pu);
@ -1982,8 +1989,8 @@ begin
end;
pu := GetProps(p[0],p[1]);
end;
if (pu^.CCC > 0) then begin
cccp := pu^.CCC;
if (pu^.C3 > 0) then begin
cccp := pu^.C3;
if locIsSurrogateP then
q := p + 2
else
@ -2000,7 +2007,7 @@ begin
end;
pu := GetProps(q[0],q[1]);
end;
cccq := pu^.CCC;
cccq := pu^.C3;
if (cccq > 0) and (cccp > cccq) then begin
Swap();
if (i > 1) then begin
@ -2213,7 +2220,7 @@ end;
function TUC_Prop.GetCategory: Byte;
begin
Result := Byte((CategoryData and Byte($F8)) shr 3);
Result := Byte((C and Byte($F8)) shr 3);
end;
function TUC_Prop.GetNumericValue: Double;
@ -2223,32 +2230,32 @@ end;
function TUC_Prop.GetUnifiedIdeograph : Boolean;
begin
Result := IsBitON(CategoryData,2);
Result := IsBitON(C,2);
end;
procedure TUC_Prop.SetCategory(AValue: Byte);
begin
CategoryData := Byte(CategoryData or Byte(AValue shl 3));
C := Byte(C or Byte(AValue shl 3));
end;
function TUC_Prop.GetWhiteSpace: Boolean;
begin
Result := IsBitON(CategoryData,0);
Result := IsBitON(C,0);
end;
procedure TUC_Prop.SetWhiteSpace(AValue: Boolean);
begin
SetBit(CategoryData,0,AValue);
SetBit(C,0,AValue);
end;
function TUC_Prop.GetHangulSyllable: Boolean;
begin
Result := IsBitON(CategoryData,1);
Result := IsBitON(C,1);
end;
procedure TUC_Prop.SetHangulSyllable(AValue: Boolean);
begin
SetBit(CategoryData,1,AValue);
SetBit(C,1,AValue);
end;
{ TUCA_DataBook }
@ -2834,9 +2841,9 @@ var
end else begin
puk := GetProps(Word(pk^));
end;
if (puk^.CCC = 0) or (lastUnblockedNonstarterCCC >= puk^.CCC) then
if (puk^.C3 = 0) or (lastUnblockedNonstarterCCC >= puk^.C3) then
exit(False);
lastUnblockedNonstarterCCC := puk^.CCC;
lastUnblockedNonstarterCCC := puk^.C3;
Result := True;
end;
@ -3030,9 +3037,9 @@ var
begin
Result := False;
puk := GetProps(cp);
if (puk^.CCC = 0) then
if (puk^.C3 = 0) then
exit;
lastUnblockedNonstarterCCC := puk^.CCC;
lastUnblockedNonstarterCCC := puk^.C3;
if surrogateState then
kk := i + 2
else
@ -3784,9 +3791,9 @@ var
end else begin
puk := GetProps(Word(pk^));
end;
if (puk^.CCC = 0) or (ctx^.lastUnblockedNonstarterCCC >= puk^.CCC) then
if (puk^.C3 = 0) or (ctx^.lastUnblockedNonstarterCCC >= puk^.C3) then
exit(False);
ctx^.lastUnblockedNonstarterCCC := puk^.CCC;
ctx^.lastUnblockedNonstarterCCC := puk^.C3;
Result := True;
end;
@ -3971,9 +3978,9 @@ var
begin
Result := False;
puk := GetProps(ctx^.cp);
if (puk^.CCC = 0) then
if (puk^.C3 = 0) then
exit;
ctx^.lastUnblockedNonstarterCCC := puk^.CCC;
ctx^.lastUnblockedNonstarterCCC := puk^.C3;
if ctx^.surrogateState then
kk := ctx^.i + 2
else

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,57 +0,0 @@
{ Unicode implementation tables.
Copyright (c) 2013 - 2017 by Inoussa OUEDRAOGO
Permission is hereby granted, free of charge, to any person
obtaining a copy of the Unicode data files and any associated
documentation (the "Data Files") or Unicode software and any
associated documentation (the "Software") to deal in the Data
Files or Software without restriction, including without
limitation the rights to use, copy, modify, merge, publish,
distribute, and/or sell copies of the Data Files or Software,
and to permit persons to whom the Data Files or Software are
furnished to do so, provided that (a) the above copyright
notice(s) and this permission notice appear with all copies
of the Data Files or Software, (b) both the above copyright
notice(s) and this permission notice appear in associated
documentation, and (c) there is clear notice in each modified
Data File or in the Software as well as in the documentation
associated with the Data File(s) or Software that the data or
software has been modified.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. }
unit unicodenumtable;
interface
const
UC_NUMERIC_COUNT = 142;
UC_NUMERIC_ARRAY : array[0..(UC_NUMERIC_COUNT-1)] of Double = (
0 ,1 ,2 ,3 ,4 ,5 ,6 ,7 ,8 ,
9 ,0.25 ,0.5 ,0.75 ,0.0625 ,0.125 ,0.1875 ,16 ,
10 ,100 ,1000 ,0.00625 ,0.025 ,0.0375 ,0.05 ,0.1 ,
0.15 ,0.2 ,1.5 ,2.5 ,3.5 ,4.5 ,5.5 ,6.5 ,
7.5 ,8.5 ,-0.5 ,20 ,30 ,40 ,50 ,60 ,
70 ,80 ,90 ,10000 ,17 ,18 ,19 ,0.142857142857143 ,
0.111111111111111 ,0.333333333333333 ,0.666666666666667 ,0.4 ,0.6 ,0.8 ,0.166666666666667 ,0.833333333333333 ,
0.375 ,0.625 ,0.875 ,11 ,12 ,500 ,5000 ,50000 ,
100000 ,13 ,14 ,15 ,21 ,22 ,23 ,24 ,
25 ,26 ,27 ,28 ,29 ,31 ,32 ,33 ,
34 ,35 ,36 ,37 ,38 ,39 ,41 ,42 ,
43 ,44 ,45 ,46 ,47 ,48 ,49 ,200 ,
300 ,400 ,600 ,700 ,800 ,900 ,2000 ,3000 ,
4000 ,6000 ,7000 ,8000 ,9000 ,20000 ,30000 ,40000 ,
60000 ,70000 ,80000 ,90000 ,0.916666666666667 ,200000 ,300000 ,400000 ,
500000 ,600000 ,700000 ,800000 ,900000 ,0.0833333333333333 ,0.416666666666667 ,0.583333333333333 ,
0.003125 ,0.0125 ,0.015625 ,0.03125 ,0.046875 ,216000 ,432000 ,1000000 ,
100000000 ,10000000000 ,1000000000000 ,10000000 ,20000000
);
implementation
end.

File diff suppressed because it is too large Load Diff

View File

@ -25,7 +25,7 @@ implicitunits=sysinitpas sysinitcyg sysinitgprof \
cp863 cp864 cp865 cp866 cp869 cp874 cp3021 cp8859_1 cp8859_2 cp8859_3 cp8859_4 \
cp8859_5 cp8859_6 cp8859_7 cp8859_8 cp8859_9 cp8859_10 cp8859_11 \
cp8859_13 cp8859_14 cp8859_15 cp8859_16 cpkoi8_r cpkoi8_u \
unicodedata unicodenumtable
unicodedata
# shared=$(DLLS)

View File

@ -2185,16 +2185,16 @@ function UInt24ToStr(const AValue : UInt24; const AEndian : TEndianKind): string
begin
if (AEndian = ekBig) then
Result := Format(
'(byte2 : $%s; byte1 : $%s; byte0 : $%s;)',
[ IntToHex(AValue.byte2,2), IntToHex(AValue.byte1,2),
IntToHex(AValue.byte0,2)
'(c:$%s;b:$%s;a:$%s;)',
[ IntToHex(AValue.byte2,1), IntToHex(AValue.byte1,1),
IntToHex(AValue.byte0,1)
]
)
else
Result := Format(
'(byte0 : $%s; byte1 : $%s; byte2 : $%s;)',
[ IntToHex(AValue.byte0,2), IntToHex(AValue.byte1,2),
IntToHex(AValue.byte2,2)
'(a:$%s;b:$%s;c:$%s;)',
[ IntToHex(AValue.byte0,1), IntToHex(AValue.byte1,1),
IntToHex(AValue.byte2,1)
]
);
end;
@ -2221,26 +2221,27 @@ begin
AddLine('');
AddLine('const');
AddLine(' UC_PROP_REC_COUNT = ' + IntToStr(Length(APropList)) + ';');
AddLine(' UC_PROP_ARRAY : array[0..(UC_PROP_REC_COUNT-1)] of TUC_Prop = (');
AddLine(' UC_PROP_ARRAY : array[0..(UC_PROP_REC_COUNT-1)] of TUC_Prop = (');
locLine := '';
p := @APropList[0];
for i := Low(APropList) to High(APropList) - 1 do begin
locLine := ' (CategoryData : ' + IntToStr(p^.CategoryData) + ';' +
' CCC : ' + IntToStr(p^.CCC) + ';' +
' NumericIndex : ' + IntToStr(p^.NumericIndex) + ';' +
' SimpleUpperCase : ' + UInt24ToStr(p^.SimpleUpperCase,AEndian) + ';' +
' SimpleLowerCase : ' + UInt24ToStr(p^.SimpleLowerCase,AEndian) + ';' +
' DecompositionID : ' + IntToStr(p^.DecompositionID) + '),';
AddLine(locLine);
for i := Low(APropList) to High(APropList) do begin //locLine := ' (CD:' + IntToStr(p^.CategoryData) + ';' +
locLine := locLine + '(C:' + IntToStr(p^.CategoryData) + ';' +
'C3:' + IntToStr(p^.CCC) + ';' +
'N:' + IntToStr(p^.NumericIndex) + ';' +
'UC:' + UInt24ToStr(p^.SimpleUpperCase,AEndian) + ';' +
'LC:' + UInt24ToStr(p^.SimpleLowerCase,AEndian) + ';' +
'D:' + IntToStr(p^.DecompositionID) + ')';
if (i < High(APropList)) then
locLine := locLine + ',';
if (((i+1) mod 2) = 0) then begin
locLine := ' ' + locLine;
AddLine(locLine);
locLine := '';
end;
Inc(p);
end;
locLine := //' (Category : TUnicodeCategory.' + GetEnumName(pti,Ord(p^.Category)) + ';' +
' (CategoryData : ' + IntToStr(p^.CategoryData) + ';' +
' CCC : ' + IntToStr(p^.CCC) + ';' +
' NumericIndex : ' + IntToStr(p^.NumericIndex) + ';' +
' SimpleUpperCase : ' + UInt24ToStr(p^.SimpleUpperCase,AEndian) + ';' +
' SimpleLowerCase : ' + UInt24ToStr(p^.SimpleLowerCase,AEndian) + ';' +
' DecompositionID : ' + IntToStr(p^.DecompositionID) + ')';
AddLine(locLine);
if (locLine <> '') then
AddLine( ' ' + locLine);
AddLine(' );' + sLineBreak);
end;
@ -2320,8 +2321,8 @@ begin
AddLine(' UC_DEC_BOOK_DATA_LENGTH = ' + IntToStr(Length(ABook.CodePoints)) + ';');
AddLine('type');
AddLine(' TDecompositionIndexRec = packed record');
AddLine(' StartPosition : Word;');
AddLine(' Length : Byte;');
AddLine(' S : Word; //StartPosition');
AddLine(' L : Byte; //Length');
AddLine(' end;');
AddLine(' TDecompositionBookRec = packed record');
AddLine(' Index : array[0..(UC_DEC_BOOK_INDEX_LENGTH-1)] of TDecompositionIndexRec;');
@ -2334,18 +2335,18 @@ begin
k := 0;
locLine := ' ';
for i := Low(ABook.Index) to High(ABook.Index) - 1 do begin
locLine := locLine + '(StartPosition : ' + IntToStr(p^.StartPosition) + ';' +
' Length : ' + IntToStr(p^.Length) + '), ';
locLine := locLine + '(S:' + IntToStr(p^.StartPosition) + ';' +
'L:' + IntToStr(p^.Length) + '),';
k := k + 1;
if (k >= 2) then begin
if (k >= 9) then begin
AddLine(locLine);
locLine := ' ';
k := 0;
end;
Inc(p);
end;
locLine := locLine + '(StartPosition : ' + IntToStr(p^.StartPosition) + ';' +
' Length : ' + IntToStr(p^.Length) + ')';
locLine := locLine + '(S:' + IntToStr(p^.StartPosition) + ';' +
'L:' + IntToStr(p^.Length) + ')';
AddLine(locLine);
AddLine(' ); // Index END');
@ -3402,13 +3403,19 @@ begin
for j := Low(TucaBmpSecondTableItem) to High(TucaBmpSecondTableItem) do begin
value := ASecondTable[i][j];
locLine := locLine + UInt24ToStr(value,ENDIAN_NATIVE) + ',';
if (((j+1) mod 2) = 0) then begin
if (i = c) and (j = 255) then
if (((j+1) mod 7) = 0) then begin
if (i = c) and (j = High(TucaBmpSecondTableItem)) then
Delete(locLine,Length(locLine),1);
locLine := ' ' + locLine;
AddLine(ANativeEndianStream,locLine);
locLine := '';
end;
end;
if (locLine <> '') then begin
if (i = c) then
Delete(locLine,Length(locLine),1);
locLine := ' ' + locLine;
AddLine(ANativeEndianStream,locLine);
end;
end;
AddLine(ANativeEndianStream,' );' + sLineBreak);
@ -3421,13 +3428,19 @@ begin
for j := Low(TucaBmpSecondTableItem) to High(TucaBmpSecondTableItem) do begin
value := ASecondTable[i][j];
locLine := locLine + UInt24ToStr(value,ENDIAN_NON_NATIVE) + ',';
if (((j+1) mod 2) = 0) then begin
if (i = c) and (j = 255) then
if (((j+1) mod 7) = 0) then begin
if (i = c) and (j = High(TucaBmpSecondTableItem)) then
Delete(locLine,Length(locLine),1);
locLine := ' ' + locLine;
AddLine(ANonNativeEndianStream,locLine);
locLine := '';
end;
end;
if (locLine <> '') then begin
if (i = c) then
Delete(locLine,Length(locLine),1);
locLine := ' ' + locLine;
AddLine(ANonNativeEndianStream,locLine);
end;
end;
AddLine(ANonNativeEndianStream,' );' + sLineBreak);
@ -3552,7 +3565,7 @@ begin
for j := Low(TucaOBmpSecondTableItem) to High(TucaOBmpSecondTableItem) do begin
value := ASecondTable[i][j];
locLine := locLine + UInt24ToStr(value,ENDIAN_NATIVE) + ',';
if (((j+1) mod 2) = 0) then begin
if (((j+1) mod 7) = 0) then begin
if (i = c) and (j = High(TucaOBmpSecondTableItem)) then
Delete(locLine,Length(locLine),1);
locLine := ' ' + locLine;
@ -3560,6 +3573,12 @@ begin
locLine := '';
end;
end;
if (locLine <> '') then begin
if (i = c) then
Delete(locLine,Length(locLine),1);
locLine := ' ' + locLine;
AddLine(ANativeEndianStream,locLine);
end;
end;
AddLine(ANativeEndianStream,' );' + sLineBreak);
@ -3570,7 +3589,7 @@ begin
for j := Low(TucaOBmpSecondTableItem) to High(TucaOBmpSecondTableItem) do begin
value := ASecondTable[i][j];
locLine := locLine + UInt24ToStr(value,ENDIAN_NON_NATIVE) + ',';
if (((j+1) mod 2) = 0) then begin
if (((j+1) mod 7) = 0) then begin
if (i = c) and (j = High(TucaOBmpSecondTableItem)) then
Delete(locLine,Length(locLine),1);
locLine := ' ' + locLine;
@ -3578,6 +3597,12 @@ begin
locLine := '';
end;
end;
if (locLine <> '') then begin
if (i = c) then
Delete(locLine,Length(locLine),1);
locLine := ' ' + locLine;
AddLine(ANonNativeEndianStream,locLine);
end;
end;
AddLine(ANonNativeEndianStream,' );' + sLineBreak);
end;
@ -3779,7 +3804,7 @@ begin
locLine := '';
for i := Low(AFirstTable) to High(AFirstTable) - 1 do begin
locLine := locLine + IntToStr(AFirstTable[i]) + ',';
if (((i+1) mod 16) = 0) then begin
if (((i+1) mod 20) = 0) then begin
locLine := ' ' + locLine;
AddLine(locLine);
locLine := '';
@ -3834,7 +3859,7 @@ begin
locLine := '';
for i := Low(AFirstTable) to High(AFirstTable) - 1 do begin
locLine := locLine + IntToStr(AFirstTable[i]) + ',';
if (((i+1) mod 16) = 0) then begin
if (((i+1) mod 20) = 0) then begin
locLine := ' ' + locLine;
AddLine(locLine);
locLine := '';

View File

@ -305,13 +305,14 @@ begin
binStreamNE.Clear();
binStreamOE.Clear();
WriteLn('Source generation ...', DateTimeToStr(Now));
GenerateNumericTable(stream,numericTable,False);
WriteLn('BMP Tables sources ...', DateTimeToStr(Now));
Generate3lvlBmpTables(stream,lvl3table1,lvl3table2,lvl3table3);
WriteLn('Properties Table sources ...', DateTimeToStr(Now));
tmpStream.Clear();
{tmpStream.Clear();
GenerateNumericTable(tmpStream,numericTable,True);
tmpStream.SaveToFile(outputPath + 'unicodenumtable.pas');
tmpStream.Clear();
tmpStream.Clear();}
GeneratePropTable(binStreamNE,props,ENDIAN_NATIVE);
GeneratePropTable(binStreamOE,props,ENDIAN_NON_NATIVE);
//-------------------------------------------