mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-30 17:50:19 +02:00
codetools: clean up and debugging
git-svn-id: trunk@27498 -
This commit is contained in:
parent
8b523895db
commit
6ebaacbba1
@ -93,7 +93,7 @@ function IsValidIdentPair(const NamePair: string;
|
|||||||
|
|
||||||
// line/code ends
|
// line/code ends
|
||||||
procedure GetLineStartEndAtPosition(const Source:string; Position:integer;
|
procedure GetLineStartEndAtPosition(const Source:string; Position:integer;
|
||||||
var LineStart,LineEnd:integer);
|
out LineStart,LineEnd:integer);
|
||||||
function GetLineStartPosition(const Source:string; Position:integer): integer;
|
function GetLineStartPosition(const Source:string; Position:integer): integer;
|
||||||
function LineEndCount(const Txt: string): integer; inline;
|
function LineEndCount(const Txt: string): integer; inline;
|
||||||
function LineEndCount(const Txt: string; out LengthOfLastLine:integer): integer; inline;
|
function LineEndCount(const Txt: string; out LengthOfLastLine:integer): integer; inline;
|
||||||
@ -1337,7 +1337,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
procedure GetLineStartEndAtPosition(const Source:string; Position:integer;
|
procedure GetLineStartEndAtPosition(const Source:string; Position:integer;
|
||||||
var LineStart,LineEnd:integer);
|
out LineStart,LineEnd:integer);
|
||||||
begin
|
begin
|
||||||
LineStart:=Position;
|
LineStart:=Position;
|
||||||
while (LineStart>1) and (not (Source[LineStart-1] in [#10,#13])) do
|
while (LineStart>1) and (not (Source[LineStart-1] in [#10,#13])) do
|
||||||
|
@ -38,7 +38,7 @@ uses
|
|||||||
{$IFDEF MEM_CHECK}
|
{$IFDEF MEM_CHECK}
|
||||||
MemCheck,
|
MemCheck,
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
Math, Classes, SysUtils, SourceLog, LinkScanner, FileProcs,
|
Classes, SysUtils, SourceLog, LinkScanner, FileProcs,
|
||||||
Avl_Tree, Laz_XMLCfg;
|
Avl_Tree, Laz_XMLCfg;
|
||||||
|
|
||||||
const
|
const
|
||||||
|
@ -200,7 +200,7 @@ type
|
|||||||
SourceChangeCache: TSourceChangeCache): boolean;
|
SourceChangeCache: TSourceChangeCache): boolean;
|
||||||
function CompleteEventAssignment(CleanCursorPos,
|
function CompleteEventAssignment(CleanCursorPos,
|
||||||
OldTopLine: integer; CursorNode: TCodeTreeNode;
|
OldTopLine: integer; CursorNode: TCodeTreeNode;
|
||||||
var IsEventAssignment: boolean;
|
out IsEventAssignment: boolean;
|
||||||
var NewPos: TCodeXYPosition; var NewTopLine: integer;
|
var NewPos: TCodeXYPosition; var NewTopLine: integer;
|
||||||
SourceChangeCache: TSourceChangeCache): boolean;
|
SourceChangeCache: TSourceChangeCache): boolean;
|
||||||
function CompleteLocalVariableForIn(CleanCursorPos,
|
function CompleteLocalVariableForIn(CleanCursorPos,
|
||||||
@ -1392,7 +1392,7 @@ end;
|
|||||||
|
|
||||||
function TCodeCompletionCodeTool.CompleteEventAssignment(CleanCursorPos,
|
function TCodeCompletionCodeTool.CompleteEventAssignment(CleanCursorPos,
|
||||||
OldTopLine: integer; CursorNode: TCodeTreeNode;
|
OldTopLine: integer; CursorNode: TCodeTreeNode;
|
||||||
var IsEventAssignment: boolean;
|
out IsEventAssignment: boolean;
|
||||||
var NewPos: TCodeXYPosition; var NewTopLine: integer;
|
var NewPos: TCodeXYPosition; var NewTopLine: integer;
|
||||||
SourceChangeCache: TSourceChangeCache): boolean;
|
SourceChangeCache: TSourceChangeCache): boolean;
|
||||||
var
|
var
|
||||||
|
@ -37,7 +37,7 @@ uses
|
|||||||
MemCheck,
|
MemCheck,
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
Classes, SysUtils, FileProcs, CodeTree, CodeAtom, KeywordFuncLists,
|
Classes, SysUtils, FileProcs, CodeTree, CodeAtom, KeywordFuncLists,
|
||||||
BasicCodeTools, LinkScanner, AVL_Tree, SourceChanger,
|
LinkScanner, AVL_Tree, SourceChanger,
|
||||||
CustomCodeTool, PascalParserTool, CodeToolsStructs, StdCodeTools;
|
CustomCodeTool, PascalParserTool, CodeToolsStructs, StdCodeTools;
|
||||||
|
|
||||||
type
|
type
|
||||||
|
@ -46,7 +46,7 @@ uses
|
|||||||
FindDeclarationCache, DirectoryCacher, AVL_Tree, LFMTrees, DirectivesTree,
|
FindDeclarationCache, DirectoryCacher, AVL_Tree, LFMTrees, DirectivesTree,
|
||||||
PascalParserTool, CodeToolsConfig, CustomCodeTool, FindDeclarationTool,
|
PascalParserTool, CodeToolsConfig, CustomCodeTool, FindDeclarationTool,
|
||||||
IdentCompletionTool, StdCodeTools, ResourceCodeTool, CodeToolsStructs,
|
IdentCompletionTool, StdCodeTools, ResourceCodeTool, CodeToolsStructs,
|
||||||
CodeTemplatesTool, ExtractProcTool, PascalReaderTool;
|
CodeTemplatesTool, ExtractProcTool;
|
||||||
|
|
||||||
type
|
type
|
||||||
TCodeToolManager = class;
|
TCodeToolManager = class;
|
||||||
|
@ -276,7 +276,7 @@
|
|||||||
</Item61>
|
</Item61>
|
||||||
<Item62>
|
<Item62>
|
||||||
<Filename Value="codetoolscfgscript.pas"/>
|
<Filename Value="codetoolscfgscript.pas"/>
|
||||||
<UnitName Value="codetoolscfgscript"/>
|
<UnitName Value="CodeToolsCfgScript"/>
|
||||||
</Item62>
|
</Item62>
|
||||||
</Files>
|
</Files>
|
||||||
<i18n>
|
<i18n>
|
||||||
|
@ -41,6 +41,7 @@ unit CodeToolsCfgScript;
|
|||||||
{$inline on}
|
{$inline on}
|
||||||
|
|
||||||
{off $Define VerboseCTCfgScript}
|
{off $Define VerboseCTCfgScript}
|
||||||
|
{off $DEFINE CheckCTCfgVars}
|
||||||
|
|
||||||
interface
|
interface
|
||||||
|
|
||||||
@ -179,6 +180,9 @@ type
|
|||||||
procedure Delete(Index: integer);
|
procedure Delete(Index: integer);
|
||||||
function TopItem: PCTCfgScriptStackItem;
|
function TopItem: PCTCfgScriptStackItem;
|
||||||
function TopItemOperand: PCTCfgScriptVariable;
|
function TopItemOperand: PCTCfgScriptVariable;
|
||||||
|
{$IFDEF CheckCTCfgVars}
|
||||||
|
procedure CheckOperands;
|
||||||
|
{$ENDIF}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TCTCfgScriptError }
|
{ TCTCfgScriptError }
|
||||||
@ -208,8 +212,8 @@ type
|
|||||||
procedure PushStringConstant;
|
procedure PushStringConstant;
|
||||||
procedure RunStatement(Skip: boolean);
|
procedure RunStatement(Skip: boolean);
|
||||||
procedure RunBegin(Skip: boolean);
|
procedure RunBegin(Skip: boolean);
|
||||||
procedure RunIf(Skip: boolean);
|
procedure RunIf({%H-}Skip: boolean);
|
||||||
procedure RunUndefine(Skip: boolean);
|
procedure RunUndefine({%H-}Skip: boolean);
|
||||||
procedure RunAssignment(Skip: boolean);
|
procedure RunAssignment(Skip: boolean);
|
||||||
function RunExpression: boolean; // if true the stack top has an operand
|
function RunExpression: boolean; // if true the stack top has an operand
|
||||||
function ExecuteStack(MaxLevel: integer): boolean;
|
function ExecuteStack(MaxLevel: integer): boolean;
|
||||||
@ -266,6 +270,7 @@ function CTCSVariableIsFalse(const V: PCTCfgScriptVariable): boolean;
|
|||||||
function CTCSStringToNumber(P: PChar; out Number: int64): boolean;
|
function CTCSStringToNumber(P: PChar; out Number: int64): boolean;
|
||||||
function AtomToCTCfgOperator(p: PChar): TCTCfgScriptOperator;
|
function AtomToCTCfgOperator(p: PChar): TCTCfgScriptOperator;
|
||||||
|
|
||||||
|
procedure CheckCTCSVariable(const V: PCTCfgScriptVariable);
|
||||||
function dbgs(const t: TCTCfgScriptStackItemType): string; overload;
|
function dbgs(const t: TCTCfgScriptStackItemType): string; overload;
|
||||||
function dbgs(const t: TCTCSValueType): string; overload;
|
function dbgs(const t: TCTCSValueType): string; overload;
|
||||||
function dbgs(const t: TCTCfgScriptOperator): string; overload;
|
function dbgs(const t: TCTCfgScriptOperator): string; overload;
|
||||||
@ -291,7 +296,7 @@ begin
|
|||||||
and (CompareIdentifierPtrs(PChar(OldName),AtomStart)=0)
|
and (CompareIdentifierPtrs(PChar(OldName),AtomStart)=0)
|
||||||
then begin
|
then begin
|
||||||
SrcPos:=PtrUInt(AtomStart-PChar(Src))+1;
|
SrcPos:=PtrUInt(AtomStart-PChar(Src))+1;
|
||||||
Src:=copy(Src,1,SrcPos-1)+NewName+copy(Src,SrcPos+length(OldName),length(Src));
|
Src:=copy(Src,1,SrcPos-1)+NewName+copy(Src,SrcPos+PtrUInt(length(OldName)),length(Src));
|
||||||
p:=@Src[SrcPos]+length(NewName);
|
p:=@Src[SrcPos]+length(NewName);
|
||||||
end;
|
end;
|
||||||
until false;
|
until false;
|
||||||
@ -303,6 +308,10 @@ var
|
|||||||
v1: PCTCfgScriptVariable absolute Var1;
|
v1: PCTCfgScriptVariable absolute Var1;
|
||||||
v2: PCTCfgScriptVariable absolute Var2;
|
v2: PCTCfgScriptVariable absolute Var2;
|
||||||
begin
|
begin
|
||||||
|
{$IFDEF CheckCTCfgVars}
|
||||||
|
CheckCTCSVariable(v1);
|
||||||
|
CheckCTCSVariable(v2);
|
||||||
|
{$ENDIF}
|
||||||
Result:=CompareIdentifiers(v1^.Name,v2^.Name);
|
Result:=CompareIdentifiers(v1^.Name,v2^.Name);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -311,11 +320,16 @@ var
|
|||||||
n: PChar absolute Name;
|
n: PChar absolute Name;
|
||||||
v: PCTCfgScriptVariable absolute aVar;
|
v: PCTCfgScriptVariable absolute aVar;
|
||||||
begin
|
begin
|
||||||
|
{$IFDEF CheckCTCfgVars}CheckCTCSVariable(v);{$ENDIF}
|
||||||
Result:=CompareIdentifiers(n,v^.Name);
|
Result:=CompareIdentifiers(n,v^.Name);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function AreCTCSVariablesEqual(const V1, V2: PCTCfgScriptVariable): Boolean;
|
function AreCTCSVariablesEqual(const V1, V2: PCTCfgScriptVariable): Boolean;
|
||||||
begin
|
begin
|
||||||
|
{$IFDEF CheckCTCfgVars}
|
||||||
|
CheckCTCSVariable(v1);
|
||||||
|
CheckCTCSVariable(v2);
|
||||||
|
{$ENDIF}
|
||||||
Result:=false;
|
Result:=false;
|
||||||
case V1^.ValueType of
|
case V1^.ValueType of
|
||||||
ctcsvNone:
|
ctcsvNone:
|
||||||
@ -325,9 +339,9 @@ begin
|
|||||||
ctcsvNone: exit;
|
ctcsvNone: exit;
|
||||||
ctcsvString:
|
ctcsvString:
|
||||||
if (V1^.StrLen<>V2^.StrLen)
|
if (V1^.StrLen<>V2^.StrLen)
|
||||||
or ((V1^.StrStart<>nil)
|
or ((V1^.StrStart<>nil)
|
||||||
and (not CompareMem(V1^.StrStart,V2^.StrStart,V1^.StrLen)))
|
and (not CompareMem(V1^.StrStart,V2^.StrStart,V1^.StrLen)))
|
||||||
then exit;
|
then exit;
|
||||||
ctcsvNumber:
|
ctcsvNumber:
|
||||||
if not CTCSNumberEqualsString(V2^.Number,V1^.StrStart) then exit;
|
if not CTCSNumberEqualsString(V2^.Number,V1^.StrStart) then exit;
|
||||||
end;
|
end;
|
||||||
@ -346,6 +360,10 @@ end;
|
|||||||
function AreCTCSVariablesExactEqual(const V1, V2: PCTCfgScriptVariable
|
function AreCTCSVariablesExactEqual(const V1, V2: PCTCfgScriptVariable
|
||||||
): Boolean;
|
): Boolean;
|
||||||
begin
|
begin
|
||||||
|
{$IFDEF CheckCTCfgVars}
|
||||||
|
CheckCTCSVariable(v1);
|
||||||
|
CheckCTCSVariable(v2);
|
||||||
|
{$ENDIF}
|
||||||
Result:=false;
|
Result:=false;
|
||||||
if V1^.ValueType<>V2^.ValueType then exit;
|
if V1^.ValueType<>V2^.ValueType then exit;
|
||||||
case V1^.ValueType of
|
case V1^.ValueType of
|
||||||
@ -415,6 +433,10 @@ var
|
|||||||
V1: PChar;
|
V1: PChar;
|
||||||
V2: PChar;
|
V2: PChar;
|
||||||
begin
|
begin
|
||||||
|
{$IFDEF CheckCTCfgVars}
|
||||||
|
CheckCTCSVariable(Left);
|
||||||
|
CheckCTCSVariable(Right);
|
||||||
|
{$ENDIF}
|
||||||
Result:=false;
|
Result:=false;
|
||||||
Equal:=false;
|
Equal:=false;
|
||||||
LeftIsLowerThanRight:=false;
|
LeftIsLowerThanRight:=false;
|
||||||
@ -485,7 +507,10 @@ end;
|
|||||||
function NewCTCSVariable: PCTCfgScriptVariable;
|
function NewCTCSVariable: PCTCfgScriptVariable;
|
||||||
begin
|
begin
|
||||||
New(Result);
|
New(Result);
|
||||||
FillByte(Result^,SizeOf(Result),0);
|
FillByte(Result^,SizeOf(TCTCfgScriptVariable),0);
|
||||||
|
{$IFDEF CheckCTCfgVars}
|
||||||
|
CheckCTCSVariable(Result);
|
||||||
|
{$ENDIF}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function NewCTCSVariable(CloneName: PChar): PCTCfgScriptVariable;
|
function NewCTCSVariable(CloneName: PChar): PCTCfgScriptVariable;
|
||||||
@ -499,21 +524,33 @@ begin
|
|||||||
System.Move(CloneName^,Result^.Name^,l);
|
System.Move(CloneName^,Result^.Name^,l);
|
||||||
Result^.Name[l]:=#0;
|
Result^.Name[l]:=#0;
|
||||||
end;
|
end;
|
||||||
|
{$IFDEF CheckCTCfgVars}
|
||||||
|
CheckCTCSVariable(Result);
|
||||||
|
{$ENDIF}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function CloneCTCSVariable(const V: PCTCfgScriptVariable): PCTCfgScriptVariable;
|
function CloneCTCSVariable(const V: PCTCfgScriptVariable): PCTCfgScriptVariable;
|
||||||
var
|
var
|
||||||
l: LongInt;
|
l: LongInt;
|
||||||
begin
|
begin
|
||||||
|
{$IFDEF CheckCTCfgVars}
|
||||||
|
CheckCTCSVariable(v);
|
||||||
|
{$ENDIF}
|
||||||
Result:=NewCTCSVariable(V^.Name);
|
Result:=NewCTCSVariable(V^.Name);
|
||||||
|
{$IFDEF CheckCTCfgVars}
|
||||||
|
CheckCTCSVariable(Result);
|
||||||
|
{$ENDIF}
|
||||||
Result^.ValueType:=V^.ValueType;
|
Result^.ValueType:=V^.ValueType;
|
||||||
|
{$IFDEF CheckCTCfgVars}
|
||||||
|
CheckCTCSVariable(Result);
|
||||||
|
{$ENDIF}
|
||||||
case V^.ValueType of
|
case V^.ValueType of
|
||||||
ctcsvNone: ;
|
ctcsvNone: ;
|
||||||
ctcsvString:
|
ctcsvString:
|
||||||
begin
|
begin
|
||||||
l:=V^.StrLen;
|
l:=V^.StrLen;
|
||||||
Result^.StrLen:=l;
|
|
||||||
if l>0 then begin
|
if l>0 then begin
|
||||||
|
Result^.StrLen:=l;
|
||||||
Result^.StrStart:=GetMem(l+1);
|
Result^.StrStart:=GetMem(l+1);
|
||||||
System.Move(V^.StrStart^,Result^.StrStart^,l);
|
System.Move(V^.StrStart^,Result^.StrStart^,l);
|
||||||
Result^.StrStart[l]:=#0;
|
Result^.StrStart[l]:=#0;
|
||||||
@ -522,12 +559,19 @@ begin
|
|||||||
ctcsvNumber:
|
ctcsvNumber:
|
||||||
Result^.Number:=V^.Number;
|
Result^.Number:=V^.Number;
|
||||||
end;
|
end;
|
||||||
|
{$IFDEF CheckCTCfgVars}
|
||||||
|
CheckCTCSVariable(Result);
|
||||||
|
{$ENDIF}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure SetCTCSVariableValue(const Src, Dest: PCTCfgScriptVariable);
|
procedure SetCTCSVariableValue(const Src, Dest: PCTCfgScriptVariable);
|
||||||
var
|
var
|
||||||
l: LongInt;
|
l: LongInt;
|
||||||
begin
|
begin
|
||||||
|
{$IFDEF CheckCTCfgVars}
|
||||||
|
CheckCTCSVariable(Src);
|
||||||
|
CheckCTCSVariable(Dest);
|
||||||
|
{$ENDIF}
|
||||||
if Src=Dest then exit;
|
if Src=Dest then exit;
|
||||||
case Src^.ValueType of
|
case Src^.ValueType of
|
||||||
ctcsvNone:
|
ctcsvNone:
|
||||||
@ -563,10 +607,17 @@ begin
|
|||||||
Dest^.Number:=Src^.Number;
|
Dest^.Number:=Src^.Number;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
{$IFDEF CheckCTCfgVars}
|
||||||
|
CheckCTCSVariable(Src);
|
||||||
|
CheckCTCSVariable(Dest);
|
||||||
|
{$ENDIF}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure FreeCTCSVariable(var V: PCTCfgScriptVariable);
|
procedure FreeCTCSVariable(var V: PCTCfgScriptVariable);
|
||||||
begin
|
begin
|
||||||
|
{$IFDEF CheckCTCfgVars}
|
||||||
|
CheckCTCSVariable(v);
|
||||||
|
{$ENDIF}
|
||||||
ClearCTCSVariable(V);
|
ClearCTCSVariable(V);
|
||||||
ReAllocMem(V^.Name,0);
|
ReAllocMem(V^.Name,0);
|
||||||
Dispose(V);
|
Dispose(V);
|
||||||
@ -574,15 +625,24 @@ end;
|
|||||||
|
|
||||||
procedure ClearCTCSVariable(const V: PCTCfgScriptVariable);
|
procedure ClearCTCSVariable(const V: PCTCfgScriptVariable);
|
||||||
begin
|
begin
|
||||||
|
{$IFDEF CheckCTCfgVars}
|
||||||
|
CheckCTCSVariable(v);
|
||||||
|
{$ENDIF}
|
||||||
if V^.ValueType=ctcsvString then
|
if V^.ValueType=ctcsvString then
|
||||||
ReAllocMem(V^.StrStart,0);
|
ReAllocMem(V^.StrStart,0);
|
||||||
V^.ValueType:=ctcsvNone;
|
V^.ValueType:=ctcsvNone;
|
||||||
|
{$IFDEF CheckCTCfgVars}
|
||||||
|
CheckCTCSVariable(v);
|
||||||
|
{$ENDIF}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure MakeCTCSVariableString(const V: PCTCfgScriptVariable);
|
procedure MakeCTCSVariableString(const V: PCTCfgScriptVariable);
|
||||||
var
|
var
|
||||||
s: String;
|
s: String;
|
||||||
begin
|
begin
|
||||||
|
{$IFDEF CheckCTCfgVars}
|
||||||
|
CheckCTCSVariable(V);
|
||||||
|
{$ENDIF}
|
||||||
case V^.ValueType of
|
case V^.ValueType of
|
||||||
ctcsvNone:
|
ctcsvNone:
|
||||||
begin
|
begin
|
||||||
@ -600,12 +660,18 @@ begin
|
|||||||
V^.ValueType:=ctcsvString;
|
V^.ValueType:=ctcsvString;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
{$IFDEF CheckCTCfgVars}
|
||||||
|
CheckCTCSVariable(V);
|
||||||
|
{$ENDIF}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure MakeCTCSVariableInt64(const V: PCTCfgScriptVariable);
|
procedure MakeCTCSVariableInt64(const V: PCTCfgScriptVariable);
|
||||||
var
|
var
|
||||||
i: Int64;
|
i: Int64;
|
||||||
begin
|
begin
|
||||||
|
{$IFDEF CheckCTCfgVars}
|
||||||
|
CheckCTCSVariable(V);
|
||||||
|
{$ENDIF}
|
||||||
case V^.ValueType of
|
case V^.ValueType of
|
||||||
ctcsvNone:
|
ctcsvNone:
|
||||||
begin
|
begin
|
||||||
@ -614,18 +680,28 @@ begin
|
|||||||
end;
|
end;
|
||||||
ctcsvString:
|
ctcsvString:
|
||||||
begin
|
begin
|
||||||
i:=StrToInt64Def(V^.StrStart,0);
|
if V^.StrStart<>nil then begin
|
||||||
V^.Number:=i;
|
i:=StrToInt64Def(V^.StrStart,0);
|
||||||
|
FreeMem(V^.StrStart);
|
||||||
|
V^.Number:=i;
|
||||||
|
end else
|
||||||
|
V^.Number:=0;
|
||||||
V^.ValueType:=ctcsvNumber;
|
V^.ValueType:=ctcsvNumber;
|
||||||
end;
|
end;
|
||||||
ctcsvNumber: ;
|
ctcsvNumber: ;
|
||||||
end;
|
end;
|
||||||
|
{$IFDEF CheckCTCfgVars}
|
||||||
|
CheckCTCSVariable(V);
|
||||||
|
{$ENDIF}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure MakeCTCSVariableInteger(const V: PCTCfgScriptVariable);
|
procedure MakeCTCSVariableInteger(const V: PCTCfgScriptVariable);
|
||||||
var
|
var
|
||||||
i: integer;
|
i: integer;
|
||||||
begin
|
begin
|
||||||
|
{$IFDEF CheckCTCfgVars}
|
||||||
|
CheckCTCSVariable(V);
|
||||||
|
{$ENDIF}
|
||||||
case V^.ValueType of
|
case V^.ValueType of
|
||||||
ctcsvNone:
|
ctcsvNone:
|
||||||
begin
|
begin
|
||||||
@ -634,12 +710,19 @@ begin
|
|||||||
end;
|
end;
|
||||||
ctcsvString:
|
ctcsvString:
|
||||||
begin
|
begin
|
||||||
i:=StrToIntDef(V^.StrStart,0);
|
if V^.StrStart<>nil then begin
|
||||||
V^.Number:=i;
|
i:=StrToIntDef(V^.StrStart,0);
|
||||||
|
FreeMem(V^.StrStart);
|
||||||
|
V^.Number:=i;
|
||||||
|
end else
|
||||||
|
V^.Number:=0;
|
||||||
V^.ValueType:=ctcsvNumber;
|
V^.ValueType:=ctcsvNumber;
|
||||||
end;
|
end;
|
||||||
ctcsvNumber: ;
|
ctcsvNumber: ;
|
||||||
end;
|
end;
|
||||||
|
{$IFDEF CheckCTCfgVars}
|
||||||
|
CheckCTCSVariable(V);
|
||||||
|
{$ENDIF}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure AddCTCSVariables(const AddVar, SumVar: PCTCfgScriptVariable);
|
procedure AddCTCSVariables(const AddVar, SumVar: PCTCfgScriptVariable);
|
||||||
@ -651,6 +734,10 @@ var
|
|||||||
OldLen: LongInt;
|
OldLen: LongInt;
|
||||||
s: String;
|
s: String;
|
||||||
begin
|
begin
|
||||||
|
{$IFDEF CheckCTCfgVars}
|
||||||
|
CheckCTCSVariable(AddVar);
|
||||||
|
CheckCTCSVariable(SumVar);
|
||||||
|
{$ENDIF}
|
||||||
case SumVar^.ValueType of
|
case SumVar^.ValueType of
|
||||||
ctcsvNone:
|
ctcsvNone:
|
||||||
SetCTCSVariableValue(AddVar,SumVar);
|
SetCTCSVariableValue(AddVar,SumVar);
|
||||||
@ -682,7 +769,7 @@ begin
|
|||||||
;
|
;
|
||||||
ctcsvString:
|
ctcsvString:
|
||||||
begin
|
begin
|
||||||
// convert to string and append
|
// convert SumVar from number to string and append
|
||||||
s:=IntToStr(SumVar^.Number);
|
s:=IntToStr(SumVar^.Number);
|
||||||
SumVar^.ValueType:=ctcsvString;
|
SumVar^.ValueType:=ctcsvString;
|
||||||
SumVar^.StrLen:=length(s)+AddVar^.StrLen;
|
SumVar^.StrLen:=length(s)+AddVar^.StrLen;
|
||||||
@ -700,6 +787,10 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
{$IFDEF CheckCTCfgVars}
|
||||||
|
CheckCTCSVariable(AddVar);
|
||||||
|
CheckCTCSVariable(SumVar);
|
||||||
|
{$ENDIF}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function CTCSNumberEqualsString(const Number: int64; const P: PChar): boolean;
|
function CTCSNumberEqualsString(const Number: int64; const P: PChar): boolean;
|
||||||
@ -849,6 +940,30 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure CheckCTCSVariable(const V: PCTCfgScriptVariable);
|
||||||
|
begin
|
||||||
|
if V=nil then
|
||||||
|
RaiseCatchableException('');
|
||||||
|
if (V^.Name<>nil) and (strlen(V^.Name)>255) then
|
||||||
|
RaiseCatchableException('');
|
||||||
|
case V^.ValueType of
|
||||||
|
ctcsvNone: ;
|
||||||
|
ctcsvString:
|
||||||
|
begin
|
||||||
|
if V^.StrLen=0 then begin
|
||||||
|
if V^.StrStart<>nil then
|
||||||
|
RaiseCatchableException('');
|
||||||
|
end else begin
|
||||||
|
if V^.StrStart=nil then
|
||||||
|
RaiseCatchableException('');
|
||||||
|
if strlen(V^.StrStart)<>V^.StrLen then
|
||||||
|
RaiseCatchableException('');
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
ctcsvNumber: ;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
function dbgs(const t: TCTCfgScriptStackItemType): string;
|
function dbgs(const t: TCTCfgScriptStackItemType): string;
|
||||||
begin
|
begin
|
||||||
Result:=GetEnumName(typeinfo(t),ord(t));
|
Result:=GetEnumName(typeinfo(t),ord(t));
|
||||||
@ -876,9 +991,10 @@ begin
|
|||||||
begin
|
begin
|
||||||
Result:=Result+'string=';
|
Result:=Result+'string=';
|
||||||
l:=length(Result);
|
l:=length(Result);
|
||||||
SetLength(Result,l+V^.StrLen);
|
if V^.StrLen>0 then begin
|
||||||
if V^.StrLen>0 then
|
SetLength(Result,l+V^.StrLen);
|
||||||
System.Move(V^.StrStart^,Result[l+1],V^.StrLen);
|
System.Move(V^.StrStart^,Result[l+1],V^.StrLen);
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
ctcsvNumber:
|
ctcsvNumber:
|
||||||
Result:=Result+'int64='+IntToStr(V^.Number);
|
Result:=Result+'int64='+IntToStr(V^.Number);
|
||||||
@ -887,6 +1003,9 @@ end;
|
|||||||
|
|
||||||
function GetCTCSVariableAsString(const V: PCTCfgScriptVariable): string;
|
function GetCTCSVariableAsString(const V: PCTCfgScriptVariable): string;
|
||||||
begin
|
begin
|
||||||
|
{$IFDEF CheckCTCfgVars}
|
||||||
|
CheckCTCSVariable(V);
|
||||||
|
{$ENDIF}
|
||||||
case V^.ValueType of
|
case V^.ValueType of
|
||||||
ctcsvNone: Result:='';
|
ctcsvNone: Result:='';
|
||||||
ctcsvString:
|
ctcsvString:
|
||||||
@ -905,6 +1024,9 @@ procedure SetCTCSVariableAsString(const V: PCTCfgScriptVariable; const s: string
|
|||||||
var
|
var
|
||||||
l: Integer;
|
l: Integer;
|
||||||
begin
|
begin
|
||||||
|
{$IFDEF CheckCTCfgVars}
|
||||||
|
CheckCTCSVariable(v);
|
||||||
|
{$ENDIF}
|
||||||
if V^.ValueType<>ctcsvString then begin
|
if V^.ValueType<>ctcsvString then begin
|
||||||
V^.ValueType:=ctcsvString;
|
V^.ValueType:=ctcsvString;
|
||||||
V^.StrLen:=0;
|
V^.StrLen:=0;
|
||||||
@ -917,15 +1039,24 @@ begin
|
|||||||
System.Move(s[1],V^.StrStart^,l+1); // +1 for the #0
|
System.Move(s[1],V^.StrStart^,l+1); // +1 for the #0
|
||||||
end else
|
end else
|
||||||
ReAllocMem(V^.StrStart,0);
|
ReAllocMem(V^.StrStart,0);
|
||||||
|
{$IFDEF CheckCTCfgVars}
|
||||||
|
CheckCTCSVariable(v);
|
||||||
|
{$ENDIF}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure SetCTCSVariableAsNumber(const V: PCTCfgScriptVariable; const i: int64
|
procedure SetCTCSVariableAsNumber(const V: PCTCfgScriptVariable; const i: int64
|
||||||
);
|
);
|
||||||
begin
|
begin
|
||||||
|
{$IFDEF CheckCTCfgVars}
|
||||||
|
CheckCTCSVariable(v);
|
||||||
|
{$ENDIF}
|
||||||
if (V^.ValueType=ctcsvString) and (V^.StrStart<>nil) then
|
if (V^.ValueType=ctcsvString) and (V^.StrStart<>nil) then
|
||||||
Freemem(V^.StrStart);
|
Freemem(V^.StrStart);
|
||||||
V^.ValueType:=ctcsvNumber;
|
V^.ValueType:=ctcsvNumber;
|
||||||
V^.Number:=i;
|
V^.Number:=i;
|
||||||
|
{$IFDEF CheckCTCfgVars}
|
||||||
|
CheckCTCSVariable(v);
|
||||||
|
{$ENDIF}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TCTCfgScriptVariables }
|
{ TCTCfgScriptVariables }
|
||||||
@ -1016,6 +1147,7 @@ var
|
|||||||
Item: PCTCfgScriptVariable;
|
Item: PCTCfgScriptVariable;
|
||||||
NewItem: PCTCfgScriptVariable;
|
NewItem: PCTCfgScriptVariable;
|
||||||
begin
|
begin
|
||||||
|
if Self=Source then exit;
|
||||||
Clear;
|
Clear;
|
||||||
Node:=Source.FItems.FindLowest;
|
Node:=Source.FItems.FindLowest;
|
||||||
while Node<>nil do begin
|
while Node<>nil do begin
|
||||||
@ -1104,14 +1236,10 @@ begin
|
|||||||
V:=GetVariable(Name,true);
|
V:=GetVariable(Name,true);
|
||||||
if Value='' then
|
if Value='' then
|
||||||
ClearCTCSVariable(V)
|
ClearCTCSVariable(V)
|
||||||
else begin
|
else if TryStrToInt64(Value,i) then
|
||||||
try
|
SetCTCSVariableAsNumber(V,i)
|
||||||
i:=StrToInt64(Value);
|
else
|
||||||
SetCTCSVariableAsNumber(V,i);
|
SetCTCSVariableAsString(V,Value);
|
||||||
except
|
|
||||||
SetCTCSVariableAsString(V,Value);
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TCTCfgScriptVariables.IsDefined(Name: PChar): boolean;
|
function TCTCfgScriptVariables.IsDefined(Name: PChar): boolean;
|
||||||
@ -1422,7 +1550,7 @@ begin
|
|||||||
ReadRawNextPascalAtom(Src,AtomStart);
|
ReadRawNextPascalAtom(Src,AtomStart);
|
||||||
|
|
||||||
FStack.Push(ctcssRoundBracketOpen,AtomStart);
|
FStack.Push(ctcssRoundBracketOpen,AtomStart);
|
||||||
FillByte(Value,SizeOf(Value),0);
|
FillByte(Value{%H-},SizeOf(Value),0);
|
||||||
if RunExpression then
|
if RunExpression then
|
||||||
SetCTCSVariableValue(FStack.TopItemOperand,@Value);
|
SetCTCSVariableValue(FStack.TopItemOperand,@Value);
|
||||||
if AtomStart^<>')' then begin
|
if AtomStart^<>')' then begin
|
||||||
@ -1582,8 +1710,9 @@ begin
|
|||||||
Item^.Operand.ValueType:=ctcsvString;
|
Item^.Operand.ValueType:=ctcsvString;
|
||||||
l:=Src-AtomStart;
|
l:=Src-AtomStart;
|
||||||
Item^.Operand.StrLen:=l;
|
Item^.Operand.StrLen:=l;
|
||||||
Item^.Operand.StrStart:=GetMem(l);
|
Item^.Operand.StrStart:=GetMem(l+1);
|
||||||
System.Move(AtomStart^,Item^.Operand.StrStart^,l);
|
System.Move(AtomStart^,Item^.Operand.StrStart^,l);
|
||||||
|
Item^.Operand.StrStart[l]:=#0;
|
||||||
end;
|
end;
|
||||||
ExecuteStack(1);
|
ExecuteStack(1);
|
||||||
end;
|
end;
|
||||||
@ -2308,6 +2437,9 @@ begin
|
|||||||
Item^.Typ:=Typ;
|
Item^.Typ:=Typ;
|
||||||
Item^.StartPos:=StartPos;
|
Item^.StartPos:=StartPos;
|
||||||
TopTyp:=Typ;
|
TopTyp:=Typ;
|
||||||
|
{$IFDEF CheckCTCfgVars}
|
||||||
|
CheckOperands;
|
||||||
|
{$ENDIF}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCTCfgScriptStack.Pop(Count: integer);
|
procedure TCTCfgScriptStack.Pop(Count: integer);
|
||||||
@ -2334,6 +2466,9 @@ begin
|
|||||||
TopTyp:=ctcssNone;
|
TopTyp:=ctcssNone;
|
||||||
dec(Count);
|
dec(Count);
|
||||||
end;
|
end;
|
||||||
|
{$IFDEF CheckCTCfgVars}
|
||||||
|
CheckOperands;
|
||||||
|
{$ENDIF}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCTCfgScriptStack.Delete(Index: integer);
|
procedure TCTCfgScriptStack.Delete(Index: integer);
|
||||||
@ -2352,6 +2487,9 @@ begin
|
|||||||
FillByte(Item^.Operand,SizeOf(Item^.Operand),0);
|
FillByte(Item^.Operand,SizeOf(Item^.Operand),0);
|
||||||
end;
|
end;
|
||||||
dec(Top);
|
dec(Top);
|
||||||
|
{$IFDEF CheckCTCfgVars}
|
||||||
|
CheckOperands;
|
||||||
|
{$ENDIF}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TCTCfgScriptStack.TopItem: PCTCfgScriptStackItem;
|
function TCTCfgScriptStack.TopItem: PCTCfgScriptStackItem;
|
||||||
@ -2370,6 +2508,16 @@ begin
|
|||||||
Result:=@Items[Top].Operand;
|
Result:=@Items[Top].Operand;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{$IFDEF CheckCTCfgVars}
|
||||||
|
procedure TCTCfgScriptStack.CheckOperands;
|
||||||
|
var
|
||||||
|
i: Integer;
|
||||||
|
begin
|
||||||
|
for i:=0 to Top do
|
||||||
|
CheckCTCSVariable(@Items[Top].Operand);
|
||||||
|
end;
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
{ TCTCfgScriptError }
|
{ TCTCfgScriptError }
|
||||||
|
|
||||||
constructor TCTCfgScriptError.Create(const aMsg: string; anErrorPos: PChar);
|
constructor TCTCfgScriptError.Create(const aMsg: string; anErrorPos: PChar);
|
||||||
|
@ -84,9 +84,9 @@ const
|
|||||||
|
|
||||||
type
|
type
|
||||||
|
|
||||||
{ TUnitNameLink }
|
{ TUnitFileNameLink }
|
||||||
|
|
||||||
TUnitNameLink = class
|
TUnitFileNameLink = class
|
||||||
public
|
public
|
||||||
Unit_Name: string;
|
Unit_Name: string;
|
||||||
Filename: string;
|
Filename: string;
|
||||||
@ -125,7 +125,7 @@ type
|
|||||||
FPool: TCTDirectoryCachePool;
|
FPool: TCTDirectoryCachePool;
|
||||||
FRefCount: integer;
|
FRefCount: integer;
|
||||||
FStrings: array[TCTDirCacheString] of TCTDirCacheStringRecord;
|
FStrings: array[TCTDirCacheString] of TCTDirCacheStringRecord;
|
||||||
FUnitLinksTree: TAVLTree; // tree of TUnitNameLink
|
FUnitLinksTree: TAVLTree; // tree of TUnitFileNameLink
|
||||||
FUnitLinksTreeTimeStamp: cardinal;
|
FUnitLinksTreeTimeStamp: cardinal;
|
||||||
FListing: TCTDirectoryListing;
|
FListing: TCTDirectoryListing;
|
||||||
FUnitSources: array[TCTDirectoryUnitSources] of TCTDirCacheUnitSrcRecord;
|
FUnitSources: array[TCTDirectoryUnitSources] of TCTDirCacheUnitSrcRecord;
|
||||||
@ -233,7 +233,7 @@ function ComparePCharCaseSensitive(Data1, Data2: Pointer): integer;
|
|||||||
// unit links
|
// unit links
|
||||||
function SearchUnitInUnitLinks(const UnitLinks, TheUnitName: string;
|
function SearchUnitInUnitLinks(const UnitLinks, TheUnitName: string;
|
||||||
var UnitLinkStart, UnitLinkEnd: integer; out Filename: string): boolean;
|
var UnitLinkStart, UnitLinkEnd: integer; out Filename: string): boolean;
|
||||||
function CreateUnitLinksTree(const UnitLinks: string): TAVLTree; // tree of TUnitNameLink
|
function CreateUnitLinksTree(const UnitLinks: string): TAVLTree; // tree of TUnitFileNameLink
|
||||||
function CompareUnitLinkNodes(NodeData1, NodeData2: Pointer): integer;
|
function CompareUnitLinkNodes(NodeData1, NodeData2: Pointer): integer;
|
||||||
function CompareUnitNameWithUnitLinkNode(AUnitName: Pointer;
|
function CompareUnitNameWithUnitLinkNode(AUnitName: Pointer;
|
||||||
NodeData: pointer): integer;
|
NodeData: pointer): integer;
|
||||||
@ -396,7 +396,7 @@ var
|
|||||||
UnitLinkEnd: Integer;
|
UnitLinkEnd: Integer;
|
||||||
TheUnitName: String;
|
TheUnitName: String;
|
||||||
Filename: String;
|
Filename: String;
|
||||||
NewNode: TUnitNameLink;
|
NewNode: TUnitFileNameLink;
|
||||||
begin
|
begin
|
||||||
UnitLinksTree:=TAVLTree.Create(@CompareUnitLinkNodes);
|
UnitLinksTree:=TAVLTree.Create(@CompareUnitLinkNodes);
|
||||||
UnitLinkStart:=1;
|
UnitLinkStart:=1;
|
||||||
@ -419,7 +419,7 @@ begin
|
|||||||
inc(UnitLinkEnd);
|
inc(UnitLinkEnd);
|
||||||
if UnitLinkEnd>UnitLinkStart then begin
|
if UnitLinkEnd>UnitLinkStart then begin
|
||||||
Filename:=copy(UnitLinks,UnitLinkStart,UnitLinkEnd-UnitLinkStart);
|
Filename:=copy(UnitLinks,UnitLinkStart,UnitLinkEnd-UnitLinkStart);
|
||||||
NewNode:=TUnitNameLink.Create;
|
NewNode:=TUnitFileNameLink.Create;
|
||||||
NewNode.Unit_Name:=TheUnitName;
|
NewNode.Unit_Name:=TheUnitName;
|
||||||
NewNode.Filename:=Filename;
|
NewNode.Filename:=Filename;
|
||||||
UnitLinksTree.Add(NewNode);
|
UnitLinksTree.Add(NewNode);
|
||||||
@ -438,17 +438,17 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
function CompareUnitLinkNodes(NodeData1, NodeData2: pointer): integer;
|
function CompareUnitLinkNodes(NodeData1, NodeData2: pointer): integer;
|
||||||
var Link1, Link2: TUnitNameLink;
|
var Link1, Link2: TUnitFileNameLink;
|
||||||
begin
|
begin
|
||||||
Link1:=TUnitNameLink(NodeData1);
|
Link1:=TUnitFileNameLink(NodeData1);
|
||||||
Link2:=TUnitNameLink(NodeData2);
|
Link2:=TUnitFileNameLink(NodeData2);
|
||||||
Result:=CompareText(Link1.Unit_Name,Link2.Unit_Name);
|
Result:=CompareText(Link1.Unit_Name,Link2.Unit_Name);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function CompareUnitNameWithUnitLinkNode(AUnitName: Pointer;
|
function CompareUnitNameWithUnitLinkNode(AUnitName: Pointer;
|
||||||
NodeData: pointer): integer;
|
NodeData: pointer): integer;
|
||||||
begin
|
begin
|
||||||
Result:=CompareText(String(AUnitName),TUnitNameLink(NodeData).Unit_Name);
|
Result:=CompareText(String(AUnitName),TUnitFileNameLink(NodeData).Unit_Name);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TCTDirectoryCache }
|
{ TCTDirectoryCache }
|
||||||
@ -664,7 +664,7 @@ begin
|
|||||||
+SizeOf(TAVLTreeNode)*PtrUInt(FUnitLinksTree.Count);
|
+SizeOf(TAVLTreeNode)*PtrUInt(FUnitLinksTree.Count);
|
||||||
Node:=FUnitLinksTree.FindLowest;
|
Node:=FUnitLinksTree.FindLowest;
|
||||||
while Node<>nil do begin
|
while Node<>nil do begin
|
||||||
inc(m,TUnitNameLink(Node.Data).CalcMemSize);
|
inc(m,TUnitFileNameLink(Node.Data).CalcMemSize);
|
||||||
Node:=FUnitLinksTree.FindSuccessor(Node);
|
Node:=FUnitLinksTree.FindSuccessor(Node);
|
||||||
end;
|
end;
|
||||||
Stats.Add('TCTDirectoryCache.FUnitLinksTree',m);
|
Stats.Add('TCTDirectoryCache.FUnitLinksTree',m);
|
||||||
@ -690,7 +690,7 @@ end;
|
|||||||
function TCTDirectoryCache.FindUnitLink(const AUnitName: string): string;
|
function TCTDirectoryCache.FindUnitLink(const AUnitName: string): string;
|
||||||
var
|
var
|
||||||
Node: TAVLTreeNode;
|
Node: TAVLTreeNode;
|
||||||
Link: TUnitNameLink;
|
Link: TUnitFileNameLink;
|
||||||
AliasFilename: String;
|
AliasFilename: String;
|
||||||
pe: TCTPascalExtType;
|
pe: TCTPascalExtType;
|
||||||
begin
|
begin
|
||||||
@ -703,7 +703,7 @@ begin
|
|||||||
Node:=FUnitLinksTree.FindKey(Pointer(AUnitName),
|
Node:=FUnitLinksTree.FindKey(Pointer(AUnitName),
|
||||||
@CompareUnitNameWithUnitLinkNode);
|
@CompareUnitNameWithUnitLinkNode);
|
||||||
if Node<>nil then begin
|
if Node<>nil then begin
|
||||||
Link:=TUnitNameLink(Node.Data);
|
Link:=TUnitFileNameLink(Node.Data);
|
||||||
Result:=Link.Filename;
|
Result:=Link.Filename;
|
||||||
if FileExistsCached(Result) then begin
|
if FileExistsCached(Result) then begin
|
||||||
exit;
|
exit;
|
||||||
@ -1383,9 +1383,9 @@ begin
|
|||||||
+PtrUInt(NamesLength);
|
+PtrUInt(NamesLength);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TUnitNameLink }
|
{ TUnitFileNameLink }
|
||||||
|
|
||||||
function TUnitNameLink.CalcMemSize: PtrUInt;
|
function TUnitFileNameLink.CalcMemSize: PtrUInt;
|
||||||
begin
|
begin
|
||||||
Result:=PtrUInt(InstanceSize)
|
Result:=PtrUInt(InstanceSize)
|
||||||
+MemSizeString(Unit_Name)
|
+MemSizeString(Unit_Name)
|
||||||
|
@ -759,7 +759,7 @@ type
|
|||||||
out NewPos: TCodeXYPosition; out NewTopLine: integer): boolean;
|
out NewPos: TCodeXYPosition; out NewTopLine: integer): boolean;
|
||||||
function FindDeclaration(const CursorPos: TCodeXYPosition;
|
function FindDeclaration(const CursorPos: TCodeXYPosition;
|
||||||
SearchSmartFlags: TFindSmartFlags;
|
SearchSmartFlags: TFindSmartFlags;
|
||||||
var NewTool: TFindDeclarationTool; var NewNode: TCodeTreeNode;
|
out NewTool: TFindDeclarationTool; out NewNode: TCodeTreeNode;
|
||||||
out NewPos: TCodeXYPosition; out NewTopLine: integer): boolean;
|
out NewPos: TCodeXYPosition; out NewTopLine: integer): boolean;
|
||||||
function FindDeclarationInInterface(const Identifier: string;
|
function FindDeclarationInInterface(const Identifier: string;
|
||||||
out NewPos: TCodeXYPosition; out NewTopLine: integer): boolean;
|
out NewPos: TCodeXYPosition; out NewTopLine: integer): boolean;
|
||||||
@ -1246,7 +1246,7 @@ end;
|
|||||||
|
|
||||||
function TFindDeclarationTool.FindDeclaration(const CursorPos: TCodeXYPosition;
|
function TFindDeclarationTool.FindDeclaration(const CursorPos: TCodeXYPosition;
|
||||||
SearchSmartFlags: TFindSmartFlags;
|
SearchSmartFlags: TFindSmartFlags;
|
||||||
var NewTool: TFindDeclarationTool; var NewNode: TCodeTreeNode;
|
out NewTool: TFindDeclarationTool; out NewNode: TCodeTreeNode;
|
||||||
out NewPos: TCodeXYPosition; out NewTopLine: integer): boolean;
|
out NewPos: TCodeXYPosition; out NewTopLine: integer): boolean;
|
||||||
var CleanCursorPos: integer;
|
var CleanCursorPos: integer;
|
||||||
CursorNode, ClassNode: TCodeTreeNode;
|
CursorNode, ClassNode: TCodeTreeNode;
|
||||||
|
@ -55,7 +55,7 @@ interface
|
|||||||
|
|
||||||
uses
|
uses
|
||||||
Classes, SysUtils, CodeToolsStructs, AVL_Tree,
|
Classes, SysUtils, CodeToolsStructs, AVL_Tree,
|
||||||
FileProcs, DirectivesTree, BasicCodeTools, CCodeParserTool,
|
FileProcs, BasicCodeTools, CCodeParserTool,
|
||||||
NonPascalCodeTools, KeywordFuncLists, CodeCache,
|
NonPascalCodeTools, KeywordFuncLists, CodeCache,
|
||||||
CodeTree, CodeAtom;
|
CodeTree, CodeAtom;
|
||||||
|
|
||||||
@ -1840,6 +1840,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
AVLNode:=Macros.FindSuccessor(AVLNode);
|
AVLNode:=Macros.FindSuccessor(AVLNode);
|
||||||
end;
|
end;
|
||||||
|
if Changed then ;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TH2PasTool.DeleteDirectiveNode(Node: TH2PDirectiveNode;
|
procedure TH2PasTool.DeleteDirectiveNode(Node: TH2PDirectiveNode;
|
||||||
|
@ -30,8 +30,7 @@ unit LFMTrees;
|
|||||||
interface
|
interface
|
||||||
|
|
||||||
uses
|
uses
|
||||||
Classes, SysUtils, AVL_Tree, FileProcs, BasicCodeTools, CodeCache, CodeAtom,
|
Classes, SysUtils, AVL_Tree, FileProcs, BasicCodeTools, CodeCache, TypInfo;
|
||||||
TypInfo;
|
|
||||||
|
|
||||||
type
|
type
|
||||||
{ TLFMTreeNode }
|
{ TLFMTreeNode }
|
||||||
|
@ -36,8 +36,7 @@ uses
|
|||||||
{$IFDEF MEM_CHECK}
|
{$IFDEF MEM_CHECK}
|
||||||
MemCheck,
|
MemCheck,
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
Classes, SysUtils, FileProcs, CodeAtom, CustomCodeTool, KeywordFuncLists,
|
Classes, SysUtils, FileProcs, CustomCodeTool, KeywordFuncLists;
|
||||||
BasicCodeTools;
|
|
||||||
|
|
||||||
type
|
type
|
||||||
|
|
||||||
|
@ -205,7 +205,7 @@ type
|
|||||||
function FindBlockCounterPart(const CursorPos: TCodeXYPosition;
|
function FindBlockCounterPart(const CursorPos: TCodeXYPosition;
|
||||||
out NewPos: TCodeXYPosition; out NewTopLine: integer): boolean;
|
out NewPos: TCodeXYPosition; out NewTopLine: integer): boolean;
|
||||||
function FindBlockStart(const CursorPos: TCodeXYPosition;
|
function FindBlockStart(const CursorPos: TCodeXYPosition;
|
||||||
out NewPos: TCodeXYPosition; var NewTopLine: integer): boolean;
|
out NewPos: TCodeXYPosition; out NewTopLine: integer): boolean;
|
||||||
function GuessUnclosedBlock(const CursorPos: TCodeXYPosition;
|
function GuessUnclosedBlock(const CursorPos: TCodeXYPosition;
|
||||||
out NewPos: TCodeXYPosition; out NewTopLine: integer): boolean;
|
out NewPos: TCodeXYPosition; out NewTopLine: integer): boolean;
|
||||||
function FindBlockCleanBounds(const CursorPos: TCodeXYPosition;
|
function FindBlockCleanBounds(const CursorPos: TCodeXYPosition;
|
||||||
@ -4868,7 +4868,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
function TStandardCodeTool.FindBlockStart(const CursorPos: TCodeXYPosition;
|
function TStandardCodeTool.FindBlockStart(const CursorPos: TCodeXYPosition;
|
||||||
out NewPos: TCodeXYPosition; var NewTopLine: integer): boolean;
|
out NewPos: TCodeXYPosition; out NewTopLine: integer): boolean;
|
||||||
// jump to beginning of current block
|
// jump to beginning of current block
|
||||||
// e.g. bracket open, 'begin', 'repeat', ...
|
// e.g. bracket open, 'begin', 'repeat', ...
|
||||||
var CleanCursorPos: integer;
|
var CleanCursorPos: integer;
|
||||||
|
Loading…
Reference in New Issue
Block a user