diff options
author | Robert Dewar <dewar@adacore.com> | 2008-04-08 08:47:40 +0200 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2008-04-08 08:47:40 +0200 |
commit | 868e30a5665dd5726c2da528e0dff23c3b18f1a8 (patch) | |
tree | 77d7d9886a963ac78f8b41a3084495723a3098f2 /gcc | |
parent | 151463df56379965e7782b7037a4190566aa7011 (diff) | |
download | gcc-868e30a5665dd5726c2da528e0dff23c3b18f1a8.zip gcc-868e30a5665dd5726c2da528e0dff23c3b18f1a8.tar.gz gcc-868e30a5665dd5726c2da528e0dff23c3b18f1a8.tar.bz2 |
a-strbou.ads, [...] (From_String): New procedure (for use by Stream_Convert)
2008-04-08 Robert Dewar <dewar@adacore.com>
* a-strbou.ads, a-strbou.adb (From_String): New procedure (for use by
Stream_Convert)
* sem_ch13.ads (Rep_Item_Too_Late): Document that Stream_Convert sets
FOnly
From-SVN: r134019
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ada/a-strbou.adb | 11 | ||||
-rw-r--r-- | gcc/ada/a-strbou.ads | 8 | ||||
-rw-r--r-- | gcc/ada/sem_ch13.ads | 5 |
3 files changed, 20 insertions, 4 deletions
diff --git a/gcc/ada/a-strbou.adb b/gcc/ada/a-strbou.adb index 015123a..d7ddc58 100644 --- a/gcc/ada/a-strbou.adb +++ b/gcc/ada/a-strbou.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2005, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2008, 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- -- @@ -60,6 +60,15 @@ package body Ada.Strings.Bounded is return Times (Left, Right, Max_Length); end "*"; + ----------------- + -- From_String -- + ----------------- + + function From_String (Source : String) return Bounded_String is + begin + return To_Super_String (Source, Max_Length, Error); + end From_String; + --------------- -- Replicate -- --------------- diff --git a/gcc/ada/a-strbou.ads b/gcc/ada/a-strbou.ads index 13f51a4..9961b63 100644 --- a/gcc/ada/a-strbou.ads +++ b/gcc/ada/a-strbou.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1992-2006, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2008, 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 -- @@ -469,6 +469,12 @@ package Ada.Strings.Bounded is -- the generic instantiation is compatible with the Super_String -- type declared in the Superbounded package. + function From_String (Source : String) return Bounded_String; + -- Private routine used only by Stream_Convert + + pragma Stream_Convert (Bounded_String, From_String, To_String); + -- Provide stream routines without dragging in Ada.Streams + Null_Bounded_String : constant Bounded_String := (Max_Length => Max_Length, Current_Length => 0, diff --git a/gcc/ada/sem_ch13.ads b/gcc/ada/sem_ch13.ads index 3c5681c..204a083 100644 --- a/gcc/ada/sem_ch13.ads +++ b/gcc/ada/sem_ch13.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1992-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2008, 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- -- @@ -121,7 +121,8 @@ package Sem_Ch13 is -- stream attributes, which, although certainly not subtype related -- attributes, clearly should not be subject to the para 10 restrictions -- (see AI95-00137). Similarly, we also skip the para 10 restrictions for - -- the Storage_Size case where they also clearly do not apply. + -- the Storage_Size case where they also clearly do not apply, and for + -- Stream_Convert which is in the same category as the strem attributes. -- -- If the rep item is too late, an appropriate message is output and -- True is returned, which is a signal that the caller should abandon |