-- --
-- B o d y --
-- --
--- $Revision: 1.1 $
--- --
--- Copyright (C) 2000-2001 Ada Core Technologies, Inc. --
+-- Copyright (C) 2000-2003 Ada Core Technologies, 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- --
-- however invalidate any other reasons why the executable file might be --
-- covered by the GNU Public License. --
-- --
--- GNAT is maintained by Ada Core Technologies Inc (http://www.gnat.com). --
+-- GNAT was originally developed by the GNAT team at New York University. --
+-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
(A : Simple_Action;
Session : Session_Type)
is
+ pragma Unreferenced (Session);
+
begin
A.Proc.all;
end Call;
Session : Session_Type)
return Boolean
is
+ pragma Unreferenced (Session);
+
begin
return P.Pattern.all;
end Match;
-------------
procedure Release (P : in out Pattern) is
+ pragma Unreferenced (P);
+
begin
null;
end Release;
Line : constant String := To_String (Session.Data.Current_Line);
Fields : Field_Table.Instance renames Session.Data.Fields;
- Start : Positive;
+ Start : Natural;
Stop : Natural;
- Seps : Maps.Character_Set := Maps.To_Set (S.Separators);
+ Seps : constant Maps.Character_Set := Maps.To_Set (S.Separators);
begin
-- First field start here
Fields.Table (Field_Table.Last (Fields)).Last := Stop - 1;
- -- if separators are set to the default (space and tab) we skip
+ -- If separators are set to the default (space and tab) we skip
-- all spaces and tabs following current field.
if S.Separators = Default_Separators then
Maps.To_Set (Default_Separators),
Outside,
Strings.Forward);
+
+ if Start = 0 then
+ Start := Stop + 1;
+ end if;
else
Start := Stop + 1;
end if;
Callbacks : Callback_Mode := None;
Session : Session_Type := Current_Session)
is
- Filter_Active : Boolean;
- Quit : Boolean;
+ Quit : Boolean;
begin
Open (Separators, Filename, Session);
Split_Line (Session);
if Callbacks in Only .. Pass_Through then
- Filter_Active := Apply_Filters (Session);
+ declare
+ Discard : Boolean;
+ pragma Unreferenced (Discard);
+ begin
+ Discard := Apply_Filters (Session);
+ end;
end if;
if Callbacks /= Only then
Read_Line (Session);
Split_Line (Session);
- if Callbacks in Only .. Pass_Through then
- Filter_Active := Apply_Filters (Session);
- end if;
+ case Callbacks is
+
+ when None =>
+ exit;
- exit when Callbacks = None
- or else Callbacks = Pass_Through
- or else (Callbacks = Only and then not Filter_Active);
+ when Only =>
+ Filter_Active := Apply_Filters (Session);
+ exit when not Filter_Active;
+ when Pass_Through =>
+ Filter_Active := Apply_Filters (Session);
+ exit;
+
+ end case;
end loop;
end Get_Line;
Session : Session_Type := Current_Session)
is
Filter_Active : Boolean;
+ pragma Unreferenced (Filter_Active);
+
begin
Open (Separators, Filename, Session);
is
Filters : Pattern_Action_Table.Instance renames Session.Data.Filters;
- A_Pattern : Patterns.Pattern_Matcher_Access :=
+ A_Pattern : constant Patterns.Pattern_Matcher_Access :=
new Regpat.Pattern_Matcher'(Pattern);
begin
Pattern_Action_Table.Increment_Last (Filters);
is
Filters : Pattern_Action_Table.Instance renames Session.Data.Filters;
- A_Pattern : Patterns.Pattern_Matcher_Access :=
+ A_Pattern : constant Patterns.Pattern_Matcher_Access :=
new Regpat.Pattern_Matcher'(Pattern);
begin
Pattern_Action_Table.Increment_Last (Filters);