Commit 76871f97 by Robert Dewar Committed by Arnaud Charlet

g-comlin.adb: Minor reformatting

2008-08-20  Robert Dewar  <dewar@adacore.com>

	* g-comlin.adb: Minor reformatting

From-SVN: r139319
parent dfe8dac3
...@@ -1566,8 +1566,8 @@ package body GNAT.Command_Line is ...@@ -1566,8 +1566,8 @@ package body GNAT.Command_Line is
end loop; end loop;
end if; end if;
-- Determine if the added switch is a known switch with parameter -- Test if added switch is a known switch with parameter attached
-- attached.
if Parameter = "" if Parameter = ""
and then Cmd.Config /= null and then Cmd.Config /= null
and then Cmd.Config.Switches /= null and then Cmd.Config.Switches /= null
...@@ -1580,8 +1580,10 @@ package body GNAT.Command_Line is ...@@ -1580,8 +1580,10 @@ package body GNAT.Command_Line is
Param : Natural; Param : Natural;
begin begin
-- Verify that switch starts with Sw
-- What if the "verification" fails???
if Switch'Length >= Sw'Length if Switch'Length >= Sw'Length
-- Verify that switch starts with Sw
and then Looking_At (Switch, Switch'First, Sw) and then Looking_At (Switch, Switch'First, Sw)
then then
Param := Switch'First + Sw'Length - 1; Param := Switch'First + Sw'Length - 1;
...@@ -1595,13 +1597,13 @@ package body GNAT.Command_Line is ...@@ -1595,13 +1597,13 @@ package body GNAT.Command_Line is
end loop; end loop;
end if; end if;
-- If the full Switch is a known switch with attached -- If full Switch is a known switch with attached parameter
-- parameter, then we use this parameter in the callback. -- then we use this parameter in the callback.
if Last = Switch'Last then if Last = Switch'Last then
Callback Callback
(Switch (Switch'First .. Param), (Switch (Switch'First .. Param),
Switch (Param + 1 .. Last)); Switch (Param + 1 .. Last));
return; return;
end if; end if;
...@@ -1647,7 +1649,7 @@ package body GNAT.Command_Line is ...@@ -1647,7 +1649,7 @@ package body GNAT.Command_Line is
is is
procedure Add_Simple_Switch (Simple : String; Param : String); procedure Add_Simple_Switch (Simple : String; Param : String);
-- Add a new switch that has had all its aliases expanded, and switches -- Add a new switch that has had all its aliases expanded, and switches
-- ungrouped. We know there is no more aliases in Switches -- ungrouped. We know there are no more aliases in Switches.
----------------------- -----------------------
-- Add_Simple_Switch -- -- Add_Simple_Switch --
...@@ -1675,7 +1677,7 @@ package body GNAT.Command_Line is ...@@ -1675,7 +1677,7 @@ package body GNAT.Command_Line is
end if; end if;
else else
-- Do we already have this switch ? -- Do we already have this switch?
for C in Cmd.Expanded'Range loop for C in Cmd.Expanded'Range loop
if Cmd.Expanded (C).all = Simple if Cmd.Expanded (C).all = Simple
...@@ -1760,9 +1762,9 @@ package body GNAT.Command_Line is ...@@ -1760,9 +1762,9 @@ package body GNAT.Command_Line is
Unchecked_Free (Tmp); Unchecked_Free (Tmp);
end Remove; end Remove;
------------ ---------
-- Append -- -- Add --
------------ ---------
procedure Add procedure Add
(Line : in out Argument_List_Access; (Line : in out Argument_List_Access;
...@@ -1770,6 +1772,7 @@ package body GNAT.Command_Line is ...@@ -1770,6 +1772,7 @@ package body GNAT.Command_Line is
Before : Boolean := False) Before : Boolean := False)
is is
Tmp : Argument_List_Access := Line; Tmp : Argument_List_Access := Line;
begin begin
if Tmp /= null then if Tmp /= null then
Line := new Argument_List (Tmp'First .. Tmp'Last + 1); Line := new Argument_List (Tmp'First .. Tmp'Last + 1);
...@@ -1783,6 +1786,7 @@ package body GNAT.Command_Line is ...@@ -1783,6 +1786,7 @@ package body GNAT.Command_Line is
end if; end if;
Unchecked_Free (Tmp); Unchecked_Free (Tmp);
else else
Line := new Argument_List'(1 .. 1 => Str); Line := new Argument_List'(1 .. 1 => Str);
end if; end if;
...@@ -1916,7 +1920,7 @@ package body GNAT.Command_Line is ...@@ -1916,7 +1920,7 @@ package body GNAT.Command_Line is
Remove (Cmd.Sections, C); Remove (Cmd.Sections, C);
-- The switch is necessarily unique by construction of -- The switch is necessarily unique by construction of
-- Add_Switch -- Add_Switch.
return; return;
...@@ -1948,7 +1952,7 @@ package body GNAT.Command_Line is ...@@ -1948,7 +1952,7 @@ package body GNAT.Command_Line is
Params : Argument_List_Access) Params : Argument_List_Access)
is is
function Compatible_Parameter (Param : String_Access) return Boolean; function Compatible_Parameter (Param : String_Access) return Boolean;
-- Tell if the parameter can be part of a group -- True when the parameter can be part of a group
-------------------------- --------------------------
-- Compatible_Parameter -- -- Compatible_Parameter --
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment