diff options
author | Arnaud Charlet <charlet@gcc.gnu.org> | 2010-10-08 15:02:55 +0200 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2010-10-08 15:02:55 +0200 |
commit | af31bffbb0630674cfc3cacb2fb21aa6bfd1fb26 (patch) | |
tree | 0126ea2b3ba29b875348601ed7cceb253d55ec95 /gcc/ada/a-strsea.adb | |
parent | 0db0c8367c64555fbbff491b9a340976d7a517fb (diff) | |
download | gcc-af31bffbb0630674cfc3cacb2fb21aa6bfd1fb26.zip gcc-af31bffbb0630674cfc3cacb2fb21aa6bfd1fb26.tar.gz gcc-af31bffbb0630674cfc3cacb2fb21aa6bfd1fb26.tar.bz2 |
[multiple changes]
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.
From-SVN: r165174
Diffstat (limited to 'gcc/ada/a-strsea.adb')
-rw-r--r-- | gcc/ada/a-strsea.adb | 36 |
1 files changed, 35 insertions, 1 deletions
diff --git a/gcc/ada/a-strsea.adb b/gcc/ada/a-strsea.adb index 848c063..6f458ff 100644 --- a/gcc/ada/a-strsea.adb +++ b/gcc/ada/a-strsea.adb @@ -6,7 +6,7 @@ -- -- -- 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- -- @@ -197,6 +197,40 @@ package body Ada.Strings.Search is 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) |