Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
| Comment: | chunked_strings: improive Find_Token implementation |
|---|---|
| Timelines: | family | ancestors | descendants | both | trunk |
| Files: | files | file ages | folders |
| SHA1: |
75f285cc82a12de9e3eee9da65b4fd4d |
| User & Date: | nat 2013-10-09 21:10:19.000 |
Context
|
2013-10-10
| ||
| 21:23 | chunked_strings-tests-bugfixes: new test case exposing a bug check-in: 278fda3aa5 user: nat tags: trunk | |
|
2013-10-09
| ||
| 21:10 | chunked_strings: improive Find_Token implementation check-in: 75f285cc82 user: nat tags: trunk | |
|
2013-10-08
| ||
| 21:21 | string_slices: fix Is_Subrange so that any empty range is a subrange of any range check-in: 96a6d2d262 user: nat tags: trunk | |
Changes
Changes to src/natools-chunked_strings.adb.
| ︙ | ︙ | |||
1602 1603 1604 1605 1606 1607 1608 |
procedure Find_Token (Source : in Chunked_String;
Set : in Maps.Character_Set;
Test : in Ada.Strings.Membership;
First : out Positive;
Last : out Natural)
is
| | | | > < < < < < < < < < < < | 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 |
procedure Find_Token (Source : in Chunked_String;
Set : in Maps.Character_Set;
Test : in Ada.Strings.Membership;
First : out Positive;
Last : out Natural)
is
Invert : constant array (Ada.Strings.Membership)
of Ada.Strings.Membership
:= (Ada.Strings.Inside => Ada.Strings.Outside,
Ada.Strings.Outside => Ada.Strings.Inside);
N : Natural;
begin
N := Index (Source, Set, Test);
if N = 0 then
First := 1;
Last := 0;
else
|
| ︙ | ︙ |
Changes to tests/natools-chunked_strings-tests-coverage.adb.
| ︙ | ︙ | |||
380 381 382 383 384 385 386 |
NT.Item (Report, Name, NT.Success);
end if;
exception
when Error : others => NT.Report_Exception (Report, Name, Error);
end;
declare
| | | 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 |
NT.Item (Report, Name, NT.Success);
end if;
exception
when Error : others => NT.Report_Exception (Report, Name, Error);
end;
declare
Name : constant String := "Procedure Find_Token at string end";
CS : constant Chunked_String := To_Chunked_String ("--end");
First : Positive;
Last : Natural;
begin
Find_Token
(Source => CS,
Set => Maps.To_Set ("abcdefghijklmnopqrst"),
|
| ︙ | ︙ |