2010-10-08 Robert Dewar <dewar@adacore.com>
+ * sem_prag.adb (Check_Duplicate_Pragma): New procedure
+ Add calls to this new procedure where appropriate
+
+2010-10-08 Vincent Celier <celier@adacore.com>
+
+ * a-textio.adb (Get_Chunk): Code clean up.
+
+2010-10-08 Robert Dewar <dewar@adacore.com>
+
+ * a-strbou.ads, a-strfix.adb, a-strfix.ads, a-strsea.adb, a-strsea.ads,
+ a-strsup.adb, a-strsup.ads, a-strunb-shared.adb, a-strunb-shared.ads,
+ a-strunb.adb, a-strunb.ads, a-stwibo.ads, a-stwifi.adb, a-stwifi.ads,
+ a-stwise.adb, a-stwise.ads, a-stwisu.adb, a-stwisu.ads,
+ a-stwiun-shared.adb, a-stwiun-shared.ads, a-stwiun.adb, a-stwiun.ads,
+ a-stzbou.ads, a-stzfix.adb, a-stzfix.ads, a-stzsea.adb, a-stzsea.ads,
+ a-stzsup.adb, a-stzsup.ads, a-stzunb-shared.adb, a-stzunb-shared.ads,
+ a-stzunb.adb, a-stzunb.ads (Find_Token): New version with From
+ parameter.
+
+2010-10-08 Robert Dewar <dewar@adacore.com>
+
* sem_cat.adb (Check_Categorization_Dependencies): Remote types
packages can depend on preleborated packages.
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2009, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2010, Free Software Foundation, Inc. --
-- --
-- This specification is derived from the Ada Reference Manual for use with --
-- GNAT. The copyright notice above, and the license provisions that follow --
procedure Find_Token
(Source : Bounded_String;
Set : Maps.Character_Set;
+ From : Positive;
+ Test : Membership;
+ First : out Positive;
+ Last : out Natural);
+ pragma Ada_2012 (Find_Token);
+
+ procedure Find_Token
+ (Source : Bounded_String;
+ Set : Maps.Character_Set;
Test : Membership;
First : out Positive;
Last : out Natural);
procedure Find_Token
(Source : Bounded_String;
Set : Maps.Character_Set;
+ From : Positive;
+ Test : Membership;
+ First : out Positive;
+ Last : out Natural)
+ renames Super_Find_Token;
+
+ procedure Find_Token
+ (Source : Bounded_String;
+ Set : Maps.Character_Set;
Test : Membership;
First : out Positive;
Last : out Natural)
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2009, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2010, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
procedure Find_Token
(Source : String;
Set : Maps.Character_Set;
+ From : Positive;
+ Test : Membership;
+ First : out Positive;
+ Last : out Natural)
+ renames Ada.Strings.Search.Find_Token;
+
+ procedure Find_Token
+ (Source : String;
+ Set : Maps.Character_Set;
Test : Membership;
First : out Positive;
Last : out Natural)
procedure Find_Token
(Source : String;
Set : Maps.Character_Set;
+ From : Positive;
+ Test : Membership;
+ First : out Positive;
+ Last : out Natural);
+ pragma Ada_2012 (Find_Token);
+
+ procedure Find_Token
+ (Source : String;
+ Set : Maps.Character_Set;
Test : Membership;
First : out Positive;
Last : out Natural);
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2009, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2010, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
procedure Find_Token
(Source : String;
Set : Maps.Character_Set;
+ From : Positive;
+ Test : Membership;
+ First : out Positive;
+ Last : out Natural)
+ is
+ begin
+ for J in From .. Source'Last loop
+ if Belongs (Source (J), Set, Test) then
+ First := J;
+
+ for K in J + 1 .. Source'Last loop
+ if not Belongs (Source (K), Set, Test) then
+ Last := K - 1;
+ return;
+ end if;
+ end loop;
+
+ -- Here if J indexes first char of token, and all chars after J
+ -- are in the token.
+
+ Last := Source'Last;
+ return;
+ end if;
+ end loop;
+
+ -- Here if no token found
+
+ First := From;
+ Last := 0;
+ end Find_Token;
+
+ procedure Find_Token
+ (Source : String;
+ Set : Maps.Character_Set;
Test : Membership;
First : out Positive;
Last : out Natural)
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2009, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2010, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
procedure Find_Token
(Source : String;
Set : Maps.Character_Set;
+ From : Positive;
+ Test : Membership;
+ First : out Positive;
+ Last : out Natural);
+
+ procedure Find_Token
+ (Source : String;
+ Set : Maps.Character_Set;
Test : Membership;
First : out Positive;
Last : out Natural);
-- --
-- B o d y --
-- --
--- Copyright (C) 2003-2009, Free Software Foundation, Inc. --
+-- Copyright (C) 2003-2010, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
procedure Super_Find_Token
(Source : Super_String;
Set : Maps.Character_Set;
+ From : Positive;
+ Test : Strings.Membership;
+ First : out Positive;
+ Last : out Natural)
+ is
+ begin
+ Search.Find_Token
+ (Source.Data (From .. Source.Current_Length), Set, Test, First, Last);
+ end Super_Find_Token;
+
+ procedure Super_Find_Token
+ (Source : Super_String;
+ Set : Maps.Character_Set;
Test : Strings.Membership;
First : out Positive;
Last : out Natural)
-- --
-- S p e c --
-- --
--- Copyright (C) 2003-2009, Free Software Foundation, Inc. --
+-- Copyright (C) 2003-2010, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
procedure Super_Find_Token
(Source : Super_String;
Set : Maps.Character_Set;
+ From : Positive;
+ Test : Membership;
+ First : out Positive;
+ Last : out Natural);
+
+ procedure Super_Find_Token
+ (Source : Super_String;
+ Set : Maps.Character_Set;
Test : Membership;
First : out Positive;
Last : out Natural);
procedure Find_Token
(Source : Unbounded_String;
Set : Maps.Character_Set;
+ From : Positive;
+ Test : Strings.Membership;
+ First : out Positive;
+ Last : out Natural)
+ is
+ SR : constant Shared_String_Access := Source.Reference;
+ begin
+ Search.Find_Token (SR.Data (From .. SR.Last), Set, Test, First, Last);
+ end Find_Token;
+
+ procedure Find_Token
+ (Source : Unbounded_String;
+ Set : Maps.Character_Set;
Test : Strings.Membership;
First : out Positive;
Last : out Natural)
procedure Find_Token
(Source : Unbounded_String;
Set : Maps.Character_Set;
+ From : Positive;
+ Test : Membership;
+ First : out Positive;
+ Last : out Natural);
+ pragma Ada_2012 (Find_Token);
+
+ procedure Find_Token
+ (Source : Unbounded_String;
+ Set : Maps.Character_Set;
Test : Membership;
First : out Positive;
Last : out Natural);
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2009, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2010, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
procedure Find_Token
(Source : Unbounded_String;
Set : Maps.Character_Set;
+ From : Positive;
+ Test : Strings.Membership;
+ First : out Positive;
+ Last : out Natural)
+ is
+ begin
+ Search.Find_Token
+ (Source.Reference (From .. Source.Last), Set, Test, First, Last);
+ end Find_Token;
+
+ procedure Find_Token
+ (Source : Unbounded_String;
+ Set : Maps.Character_Set;
Test : Strings.Membership;
First : out Positive;
Last : out Natural)
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2009, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2010, Free Software Foundation, Inc. --
-- --
-- This specification is derived from the Ada Reference Manual for use with --
-- GNAT. The copyright notice above, and the license provisions that follow --
procedure Find_Token
(Source : Unbounded_String;
Set : Maps.Character_Set;
+ From : Positive;
+ Test : Membership;
+ First : out Positive;
+ Last : out Natural);
+ pragma Ada_2012 (Find_Token);
+
+ procedure Find_Token
+ (Source : Unbounded_String;
+ Set : Maps.Character_Set;
Test : Membership;
First : out Positive;
Last : out Natural);
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2009, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2010, Free Software Foundation, Inc. --
-- --
-- This specification is derived from the Ada Reference Manual for use with --
-- GNAT. The copyright notice above, and the license provisions that follow --
procedure Find_Token
(Source : Bounded_Wide_String;
Set : Wide_Maps.Wide_Character_Set;
+ From : Positive;
+ Test : Membership;
+ First : out Positive;
+ Last : out Natural);
+ pragma Ada_2012 (Find_Token);
+
+ procedure Find_Token
+ (Source : Bounded_Wide_String;
+ Set : Wide_Maps.Wide_Character_Set;
Test : Membership;
First : out Positive;
Last : out Natural);
procedure Find_Token
(Source : Bounded_Wide_String;
Set : Wide_Maps.Wide_Character_Set;
+ From : Positive;
+ Test : Membership;
+ First : out Positive;
+ Last : out Natural)
+ renames Super_Find_Token;
+
+ procedure Find_Token
+ (Source : Bounded_Wide_String;
+ Set : Wide_Maps.Wide_Character_Set;
Test : Membership;
First : out Positive;
Last : out Natural)
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2009, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2010, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
procedure Find_Token
(Source : Wide_String;
Set : Wide_Maps.Wide_Character_Set;
+ From : Positive;
+ Test : Membership;
+ First : out Positive;
+ Last : out Natural)
+ renames Ada.Strings.Wide_Search.Find_Token;
+
+ procedure Find_Token
+ (Source : Wide_String;
+ Set : Wide_Maps.Wide_Character_Set;
Test : Membership;
First : out Positive;
Last : out Natural)
procedure Find_Token
(Source : Wide_String;
Set : Wide_Maps.Wide_Character_Set;
+ From : Positive;
+ Test : Membership;
+ First : out Positive;
+ Last : out Natural);
+ pragma Ada_2012 (Find_Token);
+
+ procedure Find_Token
+ (Source : Wide_String;
+ Set : Wide_Maps.Wide_Character_Set;
Test : Membership;
First : out Positive;
Last : out Natural);
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2009, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2010, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
procedure Find_Token
(Source : Wide_String;
Set : Wide_Maps.Wide_Character_Set;
+ From : Positive;
+ Test : Membership;
+ First : out Positive;
+ Last : out Natural)
+ is
+ begin
+ for J in From .. Source'Last loop
+ if Belongs (Source (J), Set, Test) then
+ First := J;
+
+ for K in J + 1 .. Source'Last loop
+ if not Belongs (Source (K), Set, Test) then
+ Last := K - 1;
+ return;
+ end if;
+ end loop;
+
+ -- Here if J indexes first char of token, and all chars after J
+ -- are in the token.
+
+ Last := Source'Last;
+ return;
+ end if;
+ end loop;
+
+ -- Here if no token found
+
+ First := From;
+ Last := 0;
+ end Find_Token;
+
+ procedure Find_Token
+ (Source : Wide_String;
+ Set : Wide_Maps.Wide_Character_Set;
Test : Membership;
First : out Positive;
Last : out Natural)
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2009, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2010, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
procedure Find_Token
(Source : Wide_String;
Set : Wide_Maps.Wide_Character_Set;
+ From : Positive;
+ Test : Membership;
+ First : out Positive;
+ Last : out Natural);
+ pragma Ada_2012 (Find_Token);
+
+ procedure Find_Token
+ (Source : Wide_String;
+ Set : Wide_Maps.Wide_Character_Set;
Test : Membership;
First : out Positive;
Last : out Natural);
-- --
-- B o d y --
-- --
--- Copyright (C) 2003-2009, Free Software Foundation, Inc. --
+-- Copyright (C) 2003-2010, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
procedure Super_Find_Token
(Source : Super_String;
Set : Wide_Maps.Wide_Character_Set;
+ From : Positive;
+ Test : Strings.Membership;
+ First : out Positive;
+ Last : out Natural)
+ is
+ begin
+ Wide_Search.Find_Token
+ (Source.Data (From .. Source.Current_Length), Set, Test, First, Last);
+ end Super_Find_Token;
+
+ procedure Super_Find_Token
+ (Source : Super_String;
+ Set : Wide_Maps.Wide_Character_Set;
Test : Strings.Membership;
First : out Positive;
Last : out Natural)
-- --
-- S p e c --
-- --
--- Copyright (C) 2003-2009, Free Software Foundation, Inc. --
+-- Copyright (C) 2003-2010, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
procedure Super_Find_Token
(Source : Super_String;
Set : Wide_Maps.Wide_Character_Set;
+ From : Positive;
+ Test : Membership;
+ First : out Positive;
+ Last : out Natural);
+
+ procedure Super_Find_Token
+ (Source : Super_String;
+ Set : Wide_Maps.Wide_Character_Set;
Test : Membership;
First : out Positive;
Last : out Natural);
procedure Find_Token
(Source : Unbounded_Wide_String;
Set : Wide_Maps.Wide_Character_Set;
+ From : Positive;
+ Test : Strings.Membership;
+ First : out Positive;
+ Last : out Natural)
+ is
+ SR : constant Shared_Wide_String_Access := Source.Reference;
+ begin
+ Wide_Search.Find_Token
+ (SR.Data (From .. SR.Last), Set, Test, First, Last);
+ end Find_Token;
+
+ procedure Find_Token
+ (Source : Unbounded_Wide_String;
+ Set : Wide_Maps.Wide_Character_Set;
Test : Strings.Membership;
First : out Positive;
Last : out Natural)
is
SR : constant Shared_Wide_String_Access := Source.Reference;
begin
- Wide_Search.Find_Token (SR.Data (1 .. SR.Last), Set, Test, First, Last);
+ Wide_Search.Find_Token
+ (SR.Data (1 .. SR.Last), Set, Test, First, Last);
end Find_Token;
----------
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2009, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2010, Free Software Foundation, Inc. --
-- --
-- This specification is derived from the Ada Reference Manual for use with --
-- GNAT. The copyright notice above, and the license provisions that follow --
procedure Find_Token
(Source : Unbounded_Wide_String;
Set : Wide_Maps.Wide_Character_Set;
+ From : Positive;
+ Test : Membership;
+ First : out Positive;
+ Last : out Natural);
+ pragma Ada_2012 (Find_Token);
+
+ procedure Find_Token
+ (Source : Unbounded_Wide_String;
+ Set : Wide_Maps.Wide_Character_Set;
Test : Membership;
First : out Positive;
Last : out Natural);
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2009, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2010, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
procedure Find_Token
(Source : Unbounded_Wide_String;
Set : Wide_Maps.Wide_Character_Set;
+ From : Positive;
+ Test : Strings.Membership;
+ First : out Positive;
+ Last : out Natural)
+ is
+ begin
+ Wide_Search.Find_Token
+ (Source.Reference (From .. Source.Last), Set, Test, First, Last);
+ end Find_Token;
+
+ procedure Find_Token
+ (Source : Unbounded_Wide_String;
+ Set : Wide_Maps.Wide_Character_Set;
Test : Strings.Membership;
First : out Positive;
Last : out Natural)
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2009, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2010, Free Software Foundation, Inc. --
-- --
-- This specification is derived from the Ada Reference Manual for use with --
-- GNAT. The copyright notice above, and the license provisions that follow --
procedure Find_Token
(Source : Unbounded_Wide_String;
Set : Wide_Maps.Wide_Character_Set;
+ From : Positive;
+ Test : Membership;
+ First : out Positive;
+ Last : out Natural);
+ pragma Ada_2012 (Find_Token);
+
+ procedure Find_Token
+ (Source : Unbounded_Wide_String;
+ Set : Wide_Maps.Wide_Character_Set;
Test : Membership;
First : out Positive;
Last : out Natural);
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2009, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2010, Free Software Foundation, Inc. --
-- --
-- This specification is derived from the Ada Reference Manual for use with --
-- GNAT. The copyright notice above, and the license provisions that follow --
procedure Find_Token
(Source : Bounded_Wide_Wide_String;
Set : Wide_Wide_Maps.Wide_Wide_Character_Set;
+ From : Positive;
+ Test : Membership;
+ First : out Positive;
+ Last : out Natural);
+ pragma Ada_2012 (Find_Token);
+
+ procedure Find_Token
+ (Source : Bounded_Wide_Wide_String;
+ Set : Wide_Wide_Maps.Wide_Wide_Character_Set;
Test : Membership;
First : out Positive;
Last : out Natural);
procedure Find_Token
(Source : Bounded_Wide_Wide_String;
Set : Wide_Wide_Maps.Wide_Wide_Character_Set;
+ From : Positive;
+ Test : Membership;
+ First : out Positive;
+ Last : out Natural)
+ renames Super_Find_Token;
+
+ procedure Find_Token
+ (Source : Bounded_Wide_Wide_String;
+ Set : Wide_Wide_Maps.Wide_Wide_Character_Set;
Test : Membership;
First : out Positive;
Last : out Natural)
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2009, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2010, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
procedure Find_Token
(Source : Wide_Wide_String;
Set : Wide_Wide_Maps.Wide_Wide_Character_Set;
+ From : Positive;
+ Test : Membership;
+ First : out Positive;
+ Last : out Natural)
+ renames Ada.Strings.Wide_Wide_Search.Find_Token;
+
+ procedure Find_Token
+ (Source : Wide_Wide_String;
+ Set : Wide_Wide_Maps.Wide_Wide_Character_Set;
Test : Membership;
First : out Positive;
Last : out Natural)
procedure Find_Token
(Source : Wide_Wide_String;
Set : Wide_Wide_Maps.Wide_Wide_Character_Set;
+ From : Positive;
+ Test : Membership;
+ First : out Positive;
+ Last : out Natural);
+ pragma Ada_2012 (Find_Token);
+
+ procedure Find_Token
+ (Source : Wide_Wide_String;
+ Set : Wide_Wide_Maps.Wide_Wide_Character_Set;
Test : Membership;
First : out Positive;
Last : out Natural);
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2009, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2010, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
procedure Find_Token
(Source : Wide_Wide_String;
Set : Wide_Wide_Maps.Wide_Wide_Character_Set;
+ From : Positive;
+ Test : Membership;
+ First : out Positive;
+ Last : out Natural)
+ is
+ begin
+ for J in From .. Source'Last loop
+ if Belongs (Source (J), Set, Test) then
+ First := J;
+
+ for K in J + 1 .. Source'Last loop
+ if not Belongs (Source (K), Set, Test) then
+ Last := K - 1;
+ return;
+ end if;
+ end loop;
+
+ -- Here if J indexes first char of token, and all chars after J
+ -- are in the token.
+
+ Last := Source'Last;
+ return;
+ end if;
+ end loop;
+
+ -- Here if no token found
+
+ First := From;
+ Last := 0;
+ end Find_Token;
+
+ procedure Find_Token
+ (Source : Wide_Wide_String;
+ Set : Wide_Wide_Maps.Wide_Wide_Character_Set;
Test : Membership;
First : out Positive;
Last : out Natural)
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2009, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2010, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
procedure Find_Token
(Source : Wide_Wide_String;
Set : Wide_Wide_Maps.Wide_Wide_Character_Set;
+ From : Positive;
+ Test : Membership;
+ First : out Positive;
+ Last : out Natural);
+
+ procedure Find_Token
+ (Source : Wide_Wide_String;
+ Set : Wide_Wide_Maps.Wide_Wide_Character_Set;
Test : Membership;
First : out Positive;
Last : out Natural);
-- --
-- B o d y --
-- --
--- Copyright (C) 2003-2009, Free Software Foundation, Inc. --
+-- Copyright (C) 2003-2010, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
procedure Super_Find_Token
(Source : Super_String;
Set : Wide_Wide_Maps.Wide_Wide_Character_Set;
+ From : Positive;
+ Test : Strings.Membership;
+ First : out Positive;
+ Last : out Natural)
+ is
+ begin
+ Wide_Wide_Search.Find_Token
+ (Source.Data (From .. Source.Current_Length), Set, Test, First, Last);
+ end Super_Find_Token;
+
+ procedure Super_Find_Token
+ (Source : Super_String;
+ Set : Wide_Wide_Maps.Wide_Wide_Character_Set;
Test : Strings.Membership;
First : out Positive;
Last : out Natural)
-- --
-- S p e c --
-- --
--- Copyright (C) 2003-2009, Free Software Foundation, Inc. --
+-- Copyright (C) 2003-2010, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
procedure Super_Find_Token
(Source : Super_String;
Set : Wide_Wide_Maps.Wide_Wide_Character_Set;
+ From : Positive;
+ Test : Membership;
+ First : out Positive;
+ Last : out Natural);
+
+ procedure Super_Find_Token
+ (Source : Super_String;
+ Set : Wide_Wide_Maps.Wide_Wide_Character_Set;
Test : Membership;
First : out Positive;
Last : out Natural);
procedure Find_Token
(Source : Unbounded_Wide_Wide_String;
Set : Wide_Wide_Maps.Wide_Wide_Character_Set;
+ From : Positive;
+ Test : Strings.Membership;
+ First : out Positive;
+ Last : out Natural)
+ is
+ SR : constant Shared_Wide_Wide_String_Access := Source.Reference;
+ begin
+ Wide_Wide_Search.Find_Token
+ (SR.Data (From .. SR.Last), Set, Test, First, Last);
+ end Find_Token;
+
+ procedure Find_Token
+ (Source : Unbounded_Wide_Wide_String;
+ Set : Wide_Wide_Maps.Wide_Wide_Character_Set;
Test : Strings.Membership;
First : out Positive;
Last : out Natural)
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2009, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2010, Free Software Foundation, Inc. --
-- --
-- This specification is derived from the Ada Reference Manual for use with --
-- GNAT. The copyright notice above, and the license provisions that follow --
procedure Find_Token
(Source : Unbounded_Wide_Wide_String;
Set : Wide_Wide_Maps.Wide_Wide_Character_Set;
+ From : Positive;
+ Test : Membership;
+ First : out Positive;
+ Last : out Natural);
+ pragma Ada_2012 (Find_Token);
+
+ procedure Find_Token
+ (Source : Unbounded_Wide_Wide_String;
+ Set : Wide_Wide_Maps.Wide_Wide_Character_Set;
Test : Membership;
First : out Positive;
Last : out Natural);
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2009, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2010, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
procedure Find_Token
(Source : Unbounded_Wide_Wide_String;
Set : Wide_Wide_Maps.Wide_Wide_Character_Set;
+ From : Positive;
+ Test : Strings.Membership;
+ First : out Positive;
+ Last : out Natural)
+ is
+ begin
+ Wide_Wide_Search.Find_Token
+ (Source.Reference (From .. Source.Last), Set, Test, First, Last);
+ end Find_Token;
+
+ procedure Find_Token
+ (Source : Unbounded_Wide_Wide_String;
+ Set : Wide_Wide_Maps.Wide_Wide_Character_Set;
Test : Strings.Membership;
First : out Positive;
Last : out Natural)
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2009, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2010, Free Software Foundation, Inc. --
-- --
-- This specification is derived from the Ada Reference Manual for use with --
-- GNAT. The copyright notice above, and the license provisions that follow --
procedure Find_Token
(Source : Unbounded_Wide_Wide_String;
Set : Wide_Wide_Maps.Wide_Wide_Character_Set;
+ From : Positive;
+ Test : Membership;
+ First : out Positive;
+ Last : out Natural);
+ pragma Ada_2012 (Find_Token);
+
+ procedure Find_Token
+ (Source : Unbounded_Wide_Wide_String;
+ Set : Wide_Wide_Maps.Wide_Wide_Character_Set;
Test : Membership;
First : out Positive;
Last : out Natural);
if P = Null_Address then
pragma Assert (Buf (N) = ASCII.NUL);
- memcpy (Item (Item'First + Last)'Address,
+ memcpy (Item (Last + 1)'Address,
Buf (1)'Address, size_t (N - 1));
Last := Last + N - 1;
K := K - 1;
end if;
- memcpy (Item (Item'First + Last)'Address,
+ memcpy (Item (Last + 1)'Address,
Buf (1)'Address, size_t (K));
Last := Last + K;
end;
-- UU_Typ is the related Unchecked_Union type. Flag In_Variant_Part
-- should be set when Comp comes from a record variant.
+ procedure Check_Duplicate_Pragma (E : Entity_Id);
+ -- Check if a pragma of the same name as the current pragma is already
+ -- chained as a rep pragma to the given entity. if so give a message
+ -- about the duplicate, using Error_Pragma so the call does not return.
+
procedure Check_Duplicated_Export_Name (Nam : Node_Id);
-- Nam is an N_String_Literal node containing the external name set by
-- an Import or Export pragma (or extended Import or Export pragma).
end if;
end Check_Component;
+ procedure Check_Duplicate_Pragma (E : Entity_Id) is
+ P : constant Node_Id := Get_Rep_Pragma (E, Pragma_Name (N));
+ begin
+ if Present (P) then
+ Error_Msg_Name_1 := Pname;
+ Error_Msg_Sloc := Sloc (P);
+ Error_Msg_NE ("pragma% for & duplicates one#", N, E);
+ raise Pragma_Exit;
+ end if;
+ end Check_Duplicate_Pragma;
+
----------------------------------
-- Check_Duplicated_Export_Name --
----------------------------------
("argument for pragma% must be library level entity", Arg1);
end if;
+ -- AI05-0033 : pragma cannot appear within a generic body, because
+ -- instance can be in a nested scope. The check that protected type
+ -- is itself a library-level declaration is done elsewhere.
+
if Inside_A_Generic then
- Error_Pragma ("pragma% cannot be used inside a generic");
+ if Ekind (Scope (Current_Scope)) = E_Generic_Package
+ and then In_Package_Body (Scope (Current_Scope))
+ then
+ Error_Pragma ("pragma% cannot be used inside a generic");
+ end if;
end if;
end Check_Interrupt_Or_Attach_Handler;
D := Declaration_Node (E);
K := Nkind (D);
+ -- Check duplicate before we chain ourselves!
+
+ Check_Duplicate_Pragma (E);
+
+ -- Now check appropriateness of the entity
+
if Is_Type (E) then
if Rep_Item_Too_Early (E, N)
or else
E := Entity (E_Id);
+ Check_Duplicate_Pragma (E);
+
if Rep_Item_Too_Early (E, N)
or else
Rep_Item_Too_Late (E, N)
D := Declaration_Node (E);
K := Nkind (D);
+ -- Check duplicate before we chain ourselves!
+
+ Check_Duplicate_Pragma (E);
+
+ -- Check appropriate entity
+
if Is_Type (E) then
if Rep_Item_Too_Early (E, N)
or else
E := Entity (E_Id);
+ -- Check duplicate before we chain ourselves!
+
+ Check_Duplicate_Pragma (E);
+
+ -- Check appropriate entity
+
if Rep_Item_Too_Early (E, N)
or else
Rep_Item_Too_Late (E, N)