Update of /cvsroot/jedidotnet/main/run
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2448/main/run
Modified Files:
Jedi.Text.Tokenization.ProviderBase.pas
Log Message:
TokenList is now cloneable (ICloneable interface implemented).
Index: Jedi.Text.Tokenization.ProviderBase.pas
===================================================================
RCS file: /cvsroot/jedidotnet/main/run/Jedi.Text.Tokenization.ProviderBase.pas,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** Jedi.Text.Tokenization.ProviderBase.pas 24 Dec 2005 12:25:13 -0000 1.2
--- Jedi.Text.Tokenization.ProviderBase.pas 31 Dec 2005 11:42:43 -0000 1.3
***************
*** 63,67 ****
'$Revision$',
'$Date$')]
! TokenList = class (&Object, ITokenProvider)
{$REGION 'Constructors'}
public
--- 63,67 ----
'$Revision$',
'$Date$')]
! TokenList = class (&Object, ITokenProvider, ICloneable)
{$REGION 'Constructors'}
public
***************
*** 83,86 ****
--- 83,90 ----
procedure SavePointer;
{$ENDREGION}
+ {$REGION 'ICloneable methods'}
+ strict protected
+ function Clone: &Object;
+ {$ENDREGION}
{$REGION 'List management methods'}
public
***************
*** 95,98 ****
--- 99,105 ----
{$AUTOBOX ON}
+ type
+ IntegerArray = array of Integer;
+
{$REGION 'TokenList'}
constructor TokenList.Create;
***************
*** 114,117 ****
--- 121,132 ----
end;
+ function TokenList.Clone: &Object;
+ begin
+ Result := TokenList.Create;
+ TokenList(Result).FIndex := FIndex;
+ TokenList(Result).FList := IList(ICloneable(FList).Clone);
+ TokenList(Result).FSavePoints := Stack(ICloneable(FSavePoints).Clone);
+ end;
+
procedure TokenList.DiscardPointer;
begin
***************
*** 135,145 ****
Result := Succ(FIndex) < FList.Count;
if Result then
! Inc(FIndex)
! else
! if FSavePoints.Count = 0 then
! begin
! FIndex := -1;
! FList.Clear;
! end;
end;
--- 150,154 ----
Result := Succ(FIndex) < FList.Count;
if Result then
! Inc(FIndex);
end;
|