Skip to content

Commit

Permalink
Rename global objects to have To_ prefix.
Browse files Browse the repository at this point in the history
  • Loading branch information
godunko committed Jan 10, 2024
1 parent db8ef0c commit 369c54e
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 45 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ package body VSS.Regular_Expressions.Name_Sets is

Cursor :=
Map.Find
(VSS.Transformers.Casing.Simple_Lowercase.Transform (Name));
(VSS.Transformers.Casing.To_Simple_Lowercase.Transform (Name));

if Category_Maps.Maps.Has_Element (Cursor) then
Value := Category_Maps.Maps.Element (Cursor);
Expand Down
8 changes: 4 additions & 4 deletions source/text/vss-transformers-casing.ads
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,13 @@ package VSS.Transformers.Casing is
Item : in out VSS.Strings.Virtual_String'Class);
-- @private

Lowercase : constant Lowercase_Transformer :=
To_Lowercase : constant Lowercase_Transformer :=
Lowercase_Transformer'(null record);
Simple_Lowercase : constant Simple_Lowercase_Transformer :=
To_Simple_Lowercase : constant Simple_Lowercase_Transformer :=
Simple_Lowercase_Transformer'(null record);
Simple_Uppercase : constant Simple_Uppercase_Transformer :=
To_Simple_Uppercase : constant Simple_Uppercase_Transformer :=
Simple_Uppercase_Transformer'(null record);
Uppercase : constant Uppercase_Transformer :=
To_Uppercase : constant Uppercase_Transformer :=
Uppercase_Transformer'(null record);

-- Lowercase : constant Abstract_Transformer'Class :=
Expand Down
8 changes: 4 additions & 4 deletions source/text/vss-transformers-normalization.ads
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,13 @@ package VSS.Transformers.Normalization is
Item : in out VSS.Strings.Virtual_String'Class);
-- @private

Normalization_Form_D : constant Normalization_Form_D_Transformer :=
To_Normalization_Form_D : constant Normalization_Form_D_Transformer :=
Normalization_Form_D_Transformer'(null record);
Normalization_Form_C : constant Normalization_Form_C_Transformer :=
To_Normalization_Form_C : constant Normalization_Form_C_Transformer :=
Normalization_Form_C_Transformer'(null record);
Normalization_Form_KD : constant Normalization_Form_KD_Transformer :=
To_Normalization_Form_KD : constant Normalization_Form_KD_Transformer :=
Normalization_Form_KD_Transformer'(null record);
Normalization_Form_KC : constant Normalization_Form_KC_Transformer :=
To_Normalization_Form_KC : constant Normalization_Form_KC_Transformer :=
Normalization_Form_KC_Transformer'(null record);

-- Normalization_Form_D : constant Abstract_Transformer'Class :=
Expand Down
32 changes: 18 additions & 14 deletions testsuite/text/test_transformer-test_casing_minimal.adb
Original file line number Diff line number Diff line change
Expand Up @@ -54,35 +54,39 @@ procedure Test_Casing_Minimal is
VSS.Strings.Empty_Virtual_String;

begin
Test_Support.Assert (VSS.Transformers.Casing.Lowercase.Transform (S1) = E1);
Test_Support.Assert
(VSS.Transformers.Casing.Lowercase.Transform (S1S) = S1E);
(VSS.Transformers.Casing.To_Lowercase.Transform (S1) = E1);
Test_Support.Assert
(VSS.Transformers.Casing.Lowercase.Transform (S2S) = S2E);
(VSS.Transformers.Casing.To_Lowercase.Transform (S1S) = S1E);
Test_Support.Assert
(VSS.Transformers.Casing.Lowercase.Transform (S3S) = S3E);
(VSS.Transformers.Casing.To_Lowercase.Transform (S2S) = S2E);
Test_Support.Assert
(VSS.Transformers.Casing.Lowercase.Transform (S4S) = S4E);
(VSS.Transformers.Casing.To_Lowercase.Transform (S3S) = S3E);
Test_Support.Assert
(VSS.Transformers.Casing.Lowercase.Transform (S5S) = S5E);
(VSS.Transformers.Casing.To_Lowercase.Transform (S4S) = S4E);
Test_Support.Assert
(VSS.Transformers.Casing.Lowercase.Transform (S6S) = S6E);
(VSS.Transformers.Casing.To_Lowercase.Transform (S5S) = S5E);
Test_Support.Assert
(VSS.Transformers.Casing.To_Lowercase.Transform (S6S) = S6E);

Test_Support.Assert (VSS.Transformers.Casing.Lowercase.Transform (U1) = L1);
Test_Support.Assert (VSS.Transformers.Casing.Uppercase.Transform (L1) = U1);
Test_Support.Assert
(VSS.Transformers.Casing.To_Lowercase.Transform (U1) = L1);
Test_Support.Assert
(VSS.Transformers.Casing.To_Uppercase.Transform (L1) = U1);

-- Test for null string for code coverage of Null_String_Handler.

Test_Support.Assert (VSS.Transformers.Casing.Lowercase.Transform (SN) = SN);
Test_Support.Assert
(VSS.Transformers.Casing.To_Lowercase.Transform (SN) = SN);

-- Test of simple case conversion.

Test_Support.Assert
(VSS.Transformers.Casing.Simple_Lowercase.Transform (S1) = E1);
(VSS.Transformers.Casing.To_Simple_Lowercase.Transform (S1) = E1);
Test_Support.Assert
(VSS.Transformers.Casing.Simple_Uppercase.Transform (E1) = S1);
(VSS.Transformers.Casing.To_Simple_Uppercase.Transform (E1) = S1);
Test_Support.Assert
(VSS.Transformers.Casing.Simple_Lowercase.Transform (U1) = L1);
(VSS.Transformers.Casing.To_Simple_Lowercase.Transform (U1) = L1);
Test_Support.Assert
(VSS.Transformers.Casing.Simple_Uppercase.Transform (L1) = U1);
(VSS.Transformers.Casing.To_Simple_Uppercase.Transform (L1) = U1);
end Test_Casing_Minimal;
4 changes: 2 additions & 2 deletions testsuite/text/test_transformer-test_casing_w3c_i18n.adb
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@ begin

if Lowercase then
Test_Support.Assert
(VSS.Transformers.Casing.Lowercase.Transform (Source) = Expected);
(VSS.Transformers.Casing.To_Lowercase.Transform (Source) = Expected);

else
Test_Support.Assert
(VSS.Transformers.Casing.Uppercase.Transform (Source) = Expected);
(VSS.Transformers.Casing.To_Uppercase.Transform (Source) = Expected);
end if;
end Test_Casing_W3C_I18N;
40 changes: 20 additions & 20 deletions testsuite/text/test_transformer-test_ucd_normalizationtest.adb
Original file line number Diff line number Diff line change
Expand Up @@ -71,19 +71,19 @@ begin

declare
C1N : constant VSS.Strings.Virtual_String :=
VSS.Transformers.Normalization.Normalization_Form_C
VSS.Transformers.Normalization.To_Normalization_Form_C
.Transform (C1);
C2N : constant VSS.Strings.Virtual_String :=
VSS.Transformers.Normalization.Normalization_Form_C
VSS.Transformers.Normalization.To_Normalization_Form_C
.Transform (C2);
C3N : constant VSS.Strings.Virtual_String :=
VSS.Transformers.Normalization.Normalization_Form_C
VSS.Transformers.Normalization.To_Normalization_Form_C
.Transform (C3);
C4N : constant VSS.Strings.Virtual_String :=
VSS.Transformers.Normalization.Normalization_Form_C
VSS.Transformers.Normalization.To_Normalization_Form_C
.Transform (C4);
C5N : constant VSS.Strings.Virtual_String :=
VSS.Transformers.Normalization.Normalization_Form_C
VSS.Transformers.Normalization.To_Normalization_Form_C
.Transform (C4);

begin
Expand All @@ -98,19 +98,19 @@ begin

declare
C1N : constant VSS.Strings.Virtual_String :=
VSS.Transformers.Normalization.Normalization_Form_D
VSS.Transformers.Normalization.To_Normalization_Form_D
.Transform (C1);
C2N : constant VSS.Strings.Virtual_String :=
VSS.Transformers.Normalization.Normalization_Form_D
VSS.Transformers.Normalization.To_Normalization_Form_D
.Transform (C2);
C3N : constant VSS.Strings.Virtual_String :=
VSS.Transformers.Normalization.Normalization_Form_D
VSS.Transformers.Normalization.To_Normalization_Form_D
.Transform (C3);
C4N : constant VSS.Strings.Virtual_String :=
VSS.Transformers.Normalization.Normalization_Form_D
VSS.Transformers.Normalization.To_Normalization_Form_D
.Transform (C4);
C5N : constant VSS.Strings.Virtual_String :=
VSS.Transformers.Normalization.Normalization_Form_D
VSS.Transformers.Normalization.To_Normalization_Form_D
.Transform (C5);

begin
Expand All @@ -125,19 +125,19 @@ begin

declare
C1N : constant VSS.Strings.Virtual_String :=
VSS.Transformers.Normalization.Normalization_Form_KC
VSS.Transformers.Normalization.To_Normalization_Form_KC
.Transform (C1);
C2N : constant VSS.Strings.Virtual_String :=
VSS.Transformers.Normalization.Normalization_Form_KC
VSS.Transformers.Normalization.To_Normalization_Form_KC
.Transform (C2);
C3N : constant VSS.Strings.Virtual_String :=
VSS.Transformers.Normalization.Normalization_Form_KC
VSS.Transformers.Normalization.To_Normalization_Form_KC
.Transform (C3);
C4N : constant VSS.Strings.Virtual_String :=
VSS.Transformers.Normalization.Normalization_Form_KC
VSS.Transformers.Normalization.To_Normalization_Form_KC
.Transform (C4);
C5N : constant VSS.Strings.Virtual_String :=
VSS.Transformers.Normalization.Normalization_Form_KC
VSS.Transformers.Normalization.To_Normalization_Form_KC
.Transform (C5);

begin
Expand All @@ -152,19 +152,19 @@ begin

declare
C1N : constant VSS.Strings.Virtual_String :=
VSS.Transformers.Normalization.Normalization_Form_KD
VSS.Transformers.Normalization.To_Normalization_Form_KD
.Transform (C1);
C2N : constant VSS.Strings.Virtual_String :=
VSS.Transformers.Normalization.Normalization_Form_KD
VSS.Transformers.Normalization.To_Normalization_Form_KD
.Transform (C2);
C3N : constant VSS.Strings.Virtual_String :=
VSS.Transformers.Normalization.Normalization_Form_KD
VSS.Transformers.Normalization.To_Normalization_Form_KD
.Transform (C3);
C4N : constant VSS.Strings.Virtual_String :=
VSS.Transformers.Normalization.Normalization_Form_KD
VSS.Transformers.Normalization.To_Normalization_Form_KD
.Transform (C4);
C5N : constant VSS.Strings.Virtual_String :=
VSS.Transformers.Normalization.Normalization_Form_KD
VSS.Transformers.Normalization.To_Normalization_Form_KD
.Transform (C5);

begin
Expand Down

0 comments on commit 369c54e

Please sign in to comment.