mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-12 10:36:01 +02:00
added ipdefine.inc
git-svn-id: trunk@3976 -
This commit is contained in:
parent
2d20c163ab
commit
a2a80bb473
@ -2751,6 +2751,14 @@ begin
|
||||
'Define HL_LAZARUS','HL_LAZARUS','',da_DefineRecurse));
|
||||
DirTempl.AddChild(SubDirTempl);
|
||||
|
||||
// components/turbopower_ipro
|
||||
SubDirTempl:=TDefineTemplate.Create('TurboPower InternetPro',
|
||||
'TurboPower InternetPro components',
|
||||
'','turbopower_ipro',da_Directory);
|
||||
SubDirTempl.AddChild(TDefineTemplate.Create('IP_LAZARUS',
|
||||
'Define IP_LAZARUS','IP_LAZARUS','',da_DefineRecurse));
|
||||
DirTempl.AddChild(SubDirTempl);
|
||||
|
||||
// components/custom
|
||||
SubDirTempl:=TDefineTemplate.Create('Custom Components',
|
||||
ctsCustomComponentsDirectory,
|
||||
|
@ -904,7 +904,8 @@ begin
|
||||
writeln(DebugPrefix,'TFindDeclarationTool.FindDeclaration A CursorPos=',CursorPos.X,',',CursorPos.Y);
|
||||
{$ENDIF}
|
||||
BuildTreeAndGetCleanPos(trTillCursor,CursorPos,CleanCursorPos,
|
||||
[{$IFDEF IgnoreErrorAfterCursor}btSetIgnoreErrorPos{$ENDIF}]);
|
||||
[{$IFDEF IgnoreErrorAfterCursor}btSetIgnoreErrorPos{$ENDIF}],
|
||||
false);
|
||||
{$IFDEF CTDEBUG}
|
||||
writeln(DebugPrefix,'TFindDeclarationTool.FindDeclaration C CleanCursorPos=',CleanCursorPos);
|
||||
{$ENDIF}
|
||||
|
@ -715,7 +715,7 @@ begin
|
||||
writeln('TIdentCompletionTool.GatherIdentifiers A CursorPos=',CursorPos.X,',',CursorPos.Y);
|
||||
{$ENDIF}
|
||||
BuildTreeAndGetCleanPos(trTillCursor,CursorPos,CleanCursorPos,
|
||||
[{$IFDEF IgnoreErrorAfterCursor}btSetIgnoreErrorPos{$ENDIF}]);
|
||||
[{$IFDEF IgnoreErrorAfterCursor}btSetIgnoreErrorPos{$ENDIF}],true);
|
||||
|
||||
// find node at position
|
||||
CursorNode:=FindDeepestExpandedNodeAtPos(CleanCursorPos,true);
|
||||
|
@ -323,7 +323,7 @@ begin
|
||||
{$IFDEF CTDEBUG}
|
||||
writeln('TMethodJumpingCodeTool.FindJumpPoint A CursorPos=',CursorPos.X,',',CursorPos.Y);
|
||||
{$ENDIF}
|
||||
BuildTreeAndGetCleanPos(trAll,CursorPos,CleanCursorPos,[]);
|
||||
BuildTreeAndGetCleanPos(trAll,CursorPos,CleanCursorPos,[],true);
|
||||
GetLineInfo(CleanCursorPos,LineStart,LineEnd,FirstAtomStart,LastAtomEnd);
|
||||
if CleanCursorPos<FirstAtomStart then CleanCursorPos:=FirstAtomStart;
|
||||
if CleanCursorPos>=LastAtomEnd then CleanCursorPos:=LastAtomEnd-1;
|
||||
|
@ -99,7 +99,10 @@ type
|
||||
|
||||
TTreeRange = (trInterface, trAll, trTillCursor);
|
||||
|
||||
TBuildTreeFlag = (btSetIgnoreErrorPos,btKeepIgnoreErrorPos);
|
||||
TBuildTreeFlag = (
|
||||
btSetIgnoreErrorPos,
|
||||
btKeepIgnoreErrorPos
|
||||
);
|
||||
TBuildTreeFlags = set of TBuildTreeFlag;
|
||||
|
||||
TPascalParserTool = class(TMultiKeyWordListCodeTool)
|
||||
@ -203,7 +206,7 @@ type
|
||||
procedure BuildTree(OnlyInterfaceNeeded: boolean); virtual;
|
||||
procedure BuildTreeAndGetCleanPos(TreeRange: TTreeRange;
|
||||
const CursorPos: TCodeXYPosition; var CleanCursorPos: integer;
|
||||
BuildTreeFlags: TBuildTreeFlags);
|
||||
BuildTreeFlags: TBuildTreeFlags; ExceptionOnCursorPosOut: boolean);
|
||||
procedure BuildSubTreeForClass(ClassNode: TCodeTreeNode); virtual;
|
||||
procedure BuildSubTreeForBeginBlock(BeginNode: TCodeTreeNode); virtual;
|
||||
procedure BuildSubTreeForProcHead(ProcNode: TCodeTreeNode); virtual;
|
||||
@ -3938,7 +3941,8 @@ end;
|
||||
|
||||
procedure TPascalParserTool.BuildTreeAndGetCleanPos(
|
||||
TreeRange: TTreeRange; const CursorPos: TCodeXYPosition;
|
||||
var CleanCursorPos: integer; BuildTreeFlags: TBuildTreeFlags);
|
||||
var CleanCursorPos: integer; BuildTreeFlags: TBuildTreeFlags;
|
||||
ExceptionOnCursorPosOut: boolean);
|
||||
var
|
||||
Dummy: integer;
|
||||
IgnorePos: TCodePosition;
|
||||
@ -3954,7 +3958,6 @@ begin
|
||||
end
|
||||
else if (btKeepIgnoreErrorPos in BuildTreeFlags) then
|
||||
ClearIgnoreErrorAfter;
|
||||
|
||||
if (TreeRange=trTillCursor) and (not UpdateNeeded(true)) then begin
|
||||
// interface tree is valid
|
||||
// -> if there was an error, raise it again
|
||||
@ -3969,7 +3972,10 @@ begin
|
||||
BuildSubTree(CleanCursorPos);
|
||||
exit;
|
||||
end;
|
||||
// cursor is not in partially parsed code -> parse complete code
|
||||
end;
|
||||
|
||||
// parse code
|
||||
BuildTree(TreeRange=trInterface);
|
||||
if (not IgnoreErrorAfterValid) and (not EndOfSourceFound) then
|
||||
SaveRaiseException(ctsEndOfSourceNotFound);
|
||||
@ -3979,7 +3985,10 @@ begin
|
||||
BuildSubTree(CleanCursorPos);
|
||||
exit;
|
||||
end;
|
||||
if (Dummy=-2) or ExceptionOnCursorPosOut then
|
||||
RaiseException(ctsCursorPosOutsideOfCode);
|
||||
// cursor outside of clean code
|
||||
CleanCursorPos:=-1;
|
||||
end;
|
||||
|
||||
function TPascalParserTool.FindTypeNodeOfDefinition(
|
||||
@ -4437,7 +4446,8 @@ procedure TPascalParserTool.BuildSubTree(CleanCursorPos: integer);
|
||||
var
|
||||
ANode: TCodeTreeNode;
|
||||
begin
|
||||
ANode:=FindDeepestNodeAtPos(CleanCursorPos,true);
|
||||
ANode:=FindDeepestNodeAtPos(CleanCursorPos,false);
|
||||
if ANode=nil then exit;
|
||||
case ANode.Desc of
|
||||
ctnClass,ctnClassInterface:
|
||||
BuildSubTreeForClass(ANode);
|
||||
|
@ -1264,7 +1264,7 @@ begin
|
||||
StartPos:=CursorPos;
|
||||
EndPos:=CursorPos;
|
||||
Result:=true;
|
||||
BuildTreeAndGetCleanPos(trAll,CursorPos,CleanCursorPos,[]);
|
||||
BuildTreeAndGetCleanPos(trAll,CursorPos,CleanCursorPos,[],true);
|
||||
//writeln('TStandardCodeTool.GetStringConstBounds A ',CleanCursorPos,' "',copy(Src,CleanCursorPos-5,5),'" | "',copy(Src,CleanCursorPos,5),'"');
|
||||
GetCleanPosInfo(-1,CleanCursorPos,ResolveComments,SameArea);
|
||||
//writeln('TStandardCodeTool.GetStringConstBounds B ',SameArea.StartPos,'-',SameArea.EndPos,' "',copy(Src,SameArea.StartPos,SameArea.EndPos-SameArea.StartPos),'"');
|
||||
@ -1430,7 +1430,7 @@ var
|
||||
begin
|
||||
Result:=false;
|
||||
//writeln('TStandardCodeTool.GatherResourceStringSections A ');
|
||||
BuildTreeAndGetCleanPos(trAll,CursorPos,CleanCursorPos,[]);
|
||||
BuildTreeAndGetCleanPos(trAll,CursorPos,CleanCursorPos,[],true);
|
||||
CursorNode:=FindDeepestNodeAtPos(CleanCursorPos,true);
|
||||
PositionList.Clear;
|
||||
ANode:=CursorNode;
|
||||
@ -1470,7 +1470,7 @@ begin
|
||||
Result:=false;
|
||||
if ResStrIdentifier='' then exit;
|
||||
// parse source and find clean positions
|
||||
BuildTreeAndGetCleanPos(trAll,CursorPos,CleanCursorPos,[]);
|
||||
BuildTreeAndGetCleanPos(trAll,CursorPos,CleanCursorPos,[],true);
|
||||
// find resource string section
|
||||
ANode:=FindDeepestNodeAtPos(CleanCursorPos,true);
|
||||
if (ANode=nil) then exit;
|
||||
@ -1499,7 +1499,7 @@ begin
|
||||
Result:=false;
|
||||
if MaxLen<=0 then exit;
|
||||
// parse source and find clean positions
|
||||
BuildTreeAndGetCleanPos(trAll,StartCursorPos,StartPos,[]);
|
||||
BuildTreeAndGetCleanPos(trAll,StartCursorPos,StartPos,[],true);
|
||||
Dummy:=CaretToCleanPos(EndCursorPos, EndPos);
|
||||
if (Dummy<>0) and (Dummy<>-1) then exit;
|
||||
// read string constants and extract identifier characters
|
||||
@ -1635,7 +1635,7 @@ var
|
||||
begin
|
||||
Result:=false;
|
||||
// parse source and find clean positions
|
||||
BuildTreeAndGetCleanPos(trAll,StartCursorPos,StartPos,[]);
|
||||
BuildTreeAndGetCleanPos(trAll,StartCursorPos,StartPos,[],true);
|
||||
Dummy:=CaretToCleanPos(EndCursorPos, EndPos);
|
||||
if (Dummy<>0) and (Dummy<>-1) then exit;
|
||||
// read string constants and convert it
|
||||
@ -1693,7 +1693,7 @@ begin
|
||||
Result:=false;
|
||||
if PositionList=nil then exit;
|
||||
// parse source and find clean positions
|
||||
BuildTreeAndGetCleanPos(trAll,CursorPos,CleanCursorPos,[]);
|
||||
BuildTreeAndGetCleanPos(trAll,CursorPos,CleanCursorPos,[],true);
|
||||
// find resource string section
|
||||
ANode:=FindDeepestNodeAtPos(CleanCursorPos,true);
|
||||
if (ANode=nil) then exit;
|
||||
@ -1725,7 +1725,7 @@ begin
|
||||
if SourceChangeCache=nil then exit;
|
||||
SourceChangeCache.MainScanner:=Scanner;
|
||||
// parse source and find clean positions
|
||||
BuildTreeAndGetCleanPos(trAll,SectionPos,CleanSectionPos,[]);
|
||||
BuildTreeAndGetCleanPos(trAll,SectionPos,CleanSectionPos,[],true);
|
||||
// find resource string section
|
||||
SectionNode:=FindDeepestNodeAtPos(CleanSectionPos,true);
|
||||
if (SectionNode=nil) then exit;
|
||||
@ -2096,7 +2096,7 @@ begin
|
||||
Result:=false;
|
||||
try
|
||||
BuildTreeAndGetCleanPos(trTillCursor,CursorPos,CleanCursorPos,
|
||||
[{$IFDEF IgnoreErrorAfterCursor}btSetIgnoreErrorPos{$ENDIF}]);
|
||||
[{$IFDEF IgnoreErrorAfterCursor}btSetIgnoreErrorPos{$ENDIF}],true);
|
||||
LinkIndex:=Scanner.LinkIndexAtCleanPos(CleanCursorPos);
|
||||
LinkIndex:=Scanner.FindParentLink(LinkIndex);
|
||||
if LinkIndex<0 then
|
||||
|
Loading…
Reference in New Issue
Block a user