aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/prj-pp.adb
diff options
context:
space:
mode:
authorVincent Celier <celier@adacore.com>2005-06-16 10:44:38 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2005-06-16 10:44:38 +0200
commita493557f3ac51eb4c8967a5816f980ca547c2365 (patch)
tree3390ad3df2d970f1a21ad81883e24f66f98535e1 /gcc/ada/prj-pp.adb
parent88664966ce2f31c5200f94b0a45c6abe2d41de1f (diff)
downloadgcc-a493557f3ac51eb4c8967a5816f980ca547c2365.zip
gcc-a493557f3ac51eb4c8967a5816f980ca547c2365.tar.gz
gcc-a493557f3ac51eb4c8967a5816f980ca547c2365.tar.bz2
prj-part.adb (Pre_Parse_Context_Clause): Call Set_Is_Not_Last_In_List when the project file in a with clause is not the...
2005-06-14 Vincent Celier <celier@adacore.com> * prj-part.adb (Pre_Parse_Context_Clause): Call Set_Is_Not_Last_In_List when the project file in a with clause is not the last one, that is the project file name is followed by a comma. * prj-pp.adb: (First_With_In_List): New Boolean global variable (Print): Issue list of project files separated by commas in with clauses according to the values returned by Is_Not_Last_In_List. * prj-tree.ads, prj-tree.adb: (Is_Not_Last_In_List): New function (Set_Is_Not_Last_In_List): New procedure From-SVN: r101054
Diffstat (limited to 'gcc/ada/prj-pp.adb')
-rw-r--r--gcc/ada/prj-pp.adb37
1 files changed, 27 insertions, 10 deletions
diff --git a/gcc/ada/prj-pp.adb b/gcc/ada/prj-pp.adb
index b1ef31e..9dd7a0a 100644
--- a/gcc/ada/prj-pp.adb
+++ b/gcc/ada/prj-pp.adb
@@ -44,6 +44,11 @@ package body Prj.PP is
-- Column number of the last character in the line. Used to avoid
-- outputing lines longer than Max_Line_Length.
+ First_With_In_List : Boolean := True;
+ -- Indicate that the next with clause is first in a list such as
+ -- with "A", "B";
+ -- First_With_In_List will be True for "A", but not for "B".
+
procedure Indicate_Tested (Kind : Project_Node_Kind);
-- Set the corresponding component of array Not_Tested to False.
-- Only called by pragmas Debug.
@@ -318,6 +323,7 @@ package body Prj.PP is
-- with clause(s)
+ First_With_In_List := True;
Print (First_With_Clause_Of (Node, In_Tree), Indent);
Write_Empty_Line (Always => True);
end if;
@@ -356,20 +362,31 @@ package body Prj.PP is
pragma Debug (Indicate_Tested (N_With_Clause));
if Name_Of (Node, In_Tree) /= No_Name then
- Print (First_Comment_Before (Node, In_Tree), Indent);
- Start_Line (Indent);
+ if First_With_In_List then
+ Print (First_Comment_Before (Node, In_Tree), Indent);
+ Start_Line (Indent);
- if Non_Limited_Project_Node_Of (Node, In_Tree) =
- Empty_Node
- then
- Write_String ("limited ");
+ if Non_Limited_Project_Node_Of (Node, In_Tree) =
+ Empty_Node
+ then
+ Write_String ("limited ");
+ end if;
+
+ Write_String ("with ");
end if;
- Write_String ("with ");
Output_String (String_Value_Of (Node, In_Tree));
- Write_String (";");
- Write_End_Of_Line_Comment (Node);
- Print (First_Comment_After (Node, In_Tree), Indent);
+
+ if Is_Not_Last_In_List (Node, In_Tree) then
+ Write_String (", ");
+ First_With_In_List := False;
+
+ else
+ Write_String (";");
+ Write_End_Of_Line_Comment (Node);
+ Print (First_Comment_After (Node, In_Tree), Indent);
+ First_With_In_List := True;
+ end if;
end if;
Print (Next_With_Clause_Of (Node, In_Tree), Indent);