Skip to content

Commit 1966465

Browse files
committed
Minor code clean-up and reformatting.
Continued work for S415-009.
1 parent c303b64 commit 1966465

File tree

1 file changed

+23
-18
lines changed

1 file changed

+23
-18
lines changed

tools/ada2wsdl-parser.adb

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,9 @@ package body Ada2WSDL.Parser is
176176

177177
package Compute is
178178

179+
-- Compute package is used to compute the range and values for
180+
-- Bin_Op and Expr nodes.
181+
179182
generic
180183
type T is private;
181184
Zero : T;
@@ -448,11 +451,11 @@ package body Ada2WSDL.Parser is
448451
procedure Analyze_Subtype (Node : Subtype_Decl'Class) is
449452

450453
T_Name : constant String := Img (Node.F_Name);
451-
NS : constant String := Name_Space (Node);
452-
453454
T_Decl : constant Base_Type_Decl :=
454455
Node.F_Subtype.P_Designated_Type_Decl;
456+
NS : constant String := Name_Space (Node);
455457
T_Def : constant Type_Def := T_Decl.As_Type_Decl.F_Type_Def;
458+
456459
Lower, Upper : Long_Long_Integer;
457460
Type_Suffix : Unbounded_String;
458461
Array_Len : Natural;
@@ -477,9 +480,6 @@ package body Ada2WSDL.Parser is
477480
Array_Len);
478481
end;
479482

480-
-- ?? check if this can be used:
481-
-- Analyze_Array
482-
-- (T_Decl, T_Name, Node, T_Def.As_Array_Type_Def);
483483
else
484484
Generator.Register_Derived
485485
(Name_Space (Node), T_Name,
@@ -630,7 +630,7 @@ package body Ada2WSDL.Parser is
630630
procedure Analyze_Record (Node : Record_Type_Def'Class) is
631631

632632
procedure Analyze_Field (Node : Component_Decl);
633-
-- ???
633+
-- Analyze every record fields
634634

635635
-------------------
636636
-- Analyze_Field --
@@ -935,6 +935,10 @@ package body Ada2WSDL.Parser is
935935
end if;
936936
end From_Subtype;
937937

938+
------------------
939+
-- Get_Range_Op --
940+
------------------
941+
938942
function Get_Range_Op (R : Range_Spec) return Bin_Op is
939943
(if R = No_Range_Spec
940944
then No_Bin_Op
@@ -1084,13 +1088,13 @@ package body Ada2WSDL.Parser is
10841088

10851089
use type GNATCOLL.VFS.Filesystem_String;
10861090

1091+
Project : constant GPR.Project_Tree_Access :=
1092+
new GPR.Project_Tree;
10871093
Project_Filename : constant String :=
10881094
To_String (Options.Project_Filename);
10891095
Project_File : constant GNATCOLL.VFS.Virtual_File :=
10901096
GNATCOLL.VFS.Create (+Project_Filename);
1091-
1092-
Env : GPR.Project_Environment_Access;
1093-
Project : constant GPR.Project_Tree_Access := new GPR.Project_Tree;
1097+
Env : GPR.Project_Environment_Access;
10941098
begin
10951099
GPR.Initialize (Env);
10961100
Project.Load (Project_File, Env);
@@ -1293,9 +1297,10 @@ package body Ada2WSDL.Parser is
12931297
Prev_Index : Natural;
12941298
First : Positive := Deferred_Types'First;
12951299
begin
1296-
-- When analysing the deferred types we could have some more types
1297-
-- discoverred. Do the analyse of the defintions until there is no
1298-
-- more added into the deferred list.
1300+
-- When analysing the deferred types we could have some
1301+
-- more types discoverred. Do the analyse of the
1302+
-- defintions until there is no more added into the
1303+
-- deferred list.
12991304

13001305
loop
13011306
Prev_Index := Index;
@@ -1423,9 +1428,9 @@ package body Ada2WSDL.Parser is
14231428
if T_Name = "string" then
14241429
return Build_Type ("string");
14251430

1426-
elsif T_Name = "soap_base64"
1427-
or else T_Name = "utils.soap_base64"
1428-
or else T_Name = "soap.utils.soap_base64"
1431+
elsif T_Name in "soap_base64"
1432+
| "utils.soap_base64"
1433+
| "soap.utils.soap_base64"
14291434
then
14301435
return Build_Type ("SOAP_Base64");
14311436

@@ -1727,9 +1732,9 @@ package body Ada2WSDL.Parser is
17271732
T_Name : constant String := Characters.Handling.To_Lower (Name);
17281733
begin
17291734
if T_Name in "unbounded_string"
1730-
| "unbounded.unbounded_string"
1731-
| "strings.unbounded.unbounded_string"
1732-
| "ada.strings.unbounded.unbounded_string"
1735+
| "unbounded.unbounded_string"
1736+
| "strings.unbounded.unbounded_string"
1737+
| "ada.strings.unbounded.unbounded_string"
17331738
then
17341739
if Base then
17351740
return Build_Type ("string");

0 commit comments

Comments
 (0)