summaryrefslogtreecommitdiff
path: root/gcc/ada/prj-strt.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2010-10-08 10:22:31 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2010-10-08 10:22:31 +0000
commit4c3c04756a8649638033e53f6c6395acf7156cde (patch)
treeec2b5e80bfd4ae021a7fb9457b85dbe2ab34c666 /gcc/ada/prj-strt.adb
parentdc43851bf1f4c7852cf393f540ab79780c14b01d (diff)
downloadgcc-4c3c04756a8649638033e53f6c6395acf7156cde.tar.gz
2010-10-08 Robert Dewar <dewar@adacore.com>
* sem_ch3.adb: Minor reformatting. 2010-10-08 Vincent Celier <celier@adacore.com> * ali-util.adb (Get_File_Checksum): Make sure that external_as_list is not a reserved word. * prj-proc.adb (Expression): Process string list external references. * prj-strt.adb (External_Reference): Parse external_as_list external references. * prj-tree.ads (Expression_Kind_Of): Allowed for N_External_Value nodes (Set_Expression_Kind_Of): Ditto * prj.adb (Initialize): Set external_as_list as a reserved word * projects.texi: Document new string external reference external_as_list * scans.ads (Token_Type): New token Tok_External_As_List * snames.ads-tmpl: New standard name Name_External_As_List git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@165157 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/prj-strt.adb')
-rw-r--r--gcc/ada/prj-strt.adb46
1 files changed, 32 insertions, 14 deletions
diff --git a/gcc/ada/prj-strt.adb b/gcc/ada/prj-strt.adb
index 3120e172227..aa637386b4f 100644
--- a/gcc/ada/prj-strt.adb
+++ b/gcc/ada/prj-strt.adb
@@ -109,6 +109,7 @@ package body Prj.Strt is
Current_Project : Project_Node_Id;
Current_Package : Project_Node_Id;
External_Value : out Project_Node_Id;
+ Expr_Kind : in out Variable_Kind;
Flags : Processing_Flags);
-- Parse an external reference. Current token is "external"
@@ -368,23 +369,38 @@ package body Prj.Strt is
Current_Project : Project_Node_Id;
Current_Package : Project_Node_Id;
External_Value : out Project_Node_Id;
+ Expr_Kind : in out Variable_Kind;
Flags : Processing_Flags)
is
Field_Id : Project_Node_Id := Empty_Node;
+ Ext_List : Boolean := False;
begin
External_Value :=
Default_Project_Node
(Of_Kind => N_External_Value,
- In_Tree => In_Tree,
- And_Expr_Kind => Single);
+ In_Tree => In_Tree);
Set_Location_Of (External_Value, In_Tree, To => Token_Ptr);
- -- The current token is External
-
- -- Get the left parenthesis
+ -- The current token is either external or external_as_list
+ Ext_List := Token = Tok_External_As_List;
Scan (In_Tree);
+
+ if Ext_List then
+ Set_Expression_Kind_Of (External_Value, In_Tree, To => List);
+ else
+ Set_Expression_Kind_Of (External_Value, In_Tree, To => Single);
+ end if;
+
+ if Expr_Kind = Undefined then
+ if Ext_List then
+ Expr_Kind := List;
+ else
+ Expr_Kind := Single;
+ end if;
+ end if;
+
Expect (Tok_Left_Paren, "`(`");
-- Scan past the left parenthesis
@@ -413,6 +429,10 @@ package body Prj.Strt is
case Token is
when Tok_Right_Paren =>
+ if Ext_List then
+ Error_Msg (Flags, "`,` expected", Token_Ptr);
+ end if;
+
Scan (In_Tree); -- scan past right paren
when Tok_Comma =>
@@ -448,7 +468,11 @@ package body Prj.Strt is
end if;
when others =>
- Error_Msg (Flags, "`,` or `)` expected", Token_Ptr);
+ if Ext_List then
+ Error_Msg (Flags, "`,` expected", Token_Ptr);
+ else
+ Error_Msg (Flags, "`,` or `)` expected", Token_Ptr);
+ end if;
end case;
end if;
end External_Reference;
@@ -1493,19 +1517,13 @@ package body Prj.Strt is
end if;
end if;
- when Tok_External =>
-
- -- An external reference is always a single string
-
- if Expr_Kind = Undefined then
- Expr_Kind := Single;
- end if;
-
+ when Tok_External | Tok_External_As_List =>
External_Reference
(In_Tree => In_Tree,
Flags => Flags,
Current_Project => Current_Project,
Current_Package => Current_Package,
+ Expr_Kind => Expr_Kind,
External_Value => Reference);
Set_Current_Term (Term, In_Tree, To => Reference);