mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-23 13:04:43 +02:00
codetools: fixed typo
git-svn-id: trunk@35439 -
This commit is contained in:
parent
3f83e596a3
commit
af96f00a7e
@ -2094,7 +2094,7 @@ begin
|
|||||||
debugln(['TCodeCompletionCodeTool.CompleteLocalVariableByParameter Call="',ExtractCode(ProcStartPos,ProcNameAtom.EndPos,[]),'"']);
|
debugln(['TCodeCompletionCodeTool.CompleteLocalVariableByParameter Call="',ExtractCode(ProcStartPos,ProcNameAtom.EndPos,[]),'"']);
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
Params.ContextNode:=Context.Node;
|
Params.ContextNode:=Context.Node;
|
||||||
Params.Flags:=fdfDefaultForExpressions+[fdfFunctionResult,fdfFindChilds];
|
Params.Flags:=fdfDefaultForExpressions+[fdfFunctionResult,fdfFindChildren];
|
||||||
ExprType:=FindExpressionResultType(Params,ProcStartPos,ProcNameAtom.StartPos);
|
ExprType:=FindExpressionResultType(Params,ProcStartPos,ProcNameAtom.StartPos);
|
||||||
if ExprType.Desc<>xtContext then begin
|
if ExprType.Desc<>xtContext then begin
|
||||||
debugln(['TCodeCompletionCodeTool.CompleteLocalIdentifierByParameter Call="',ExtractCode(ProcStartPos,ProcNameAtom.StartPos,[]),'" gives ',ExprTypeToString(ExprType)]);
|
debugln(['TCodeCompletionCodeTool.CompleteLocalIdentifierByParameter Call="',ExtractCode(ProcStartPos,ProcNameAtom.StartPos,[]),'" gives ',ExprTypeToString(ExprType)]);
|
||||||
|
@ -1136,7 +1136,7 @@ var
|
|||||||
Params:=TFindDeclarationParams.Create;
|
Params:=TFindDeclarationParams.Create;
|
||||||
try
|
try
|
||||||
Params.ContextNode:=WithVarNode;
|
Params.ContextNode:=WithVarNode;
|
||||||
Params.Flags:=[fdfExceptionOnNotFound,fdfFunctionResult,fdfFindChilds];
|
Params.Flags:=[fdfExceptionOnNotFound,fdfFunctionResult,fdfFindChildren];
|
||||||
Cache^.WithVarExpr:=FindExpressionTypeOfTerm(WithVarNode.StartPos,-1,Params,true);
|
Cache^.WithVarExpr:=FindExpressionTypeOfTerm(WithVarNode.StartPos,-1,Params,true);
|
||||||
if (Cache^.WithVarExpr.Desc<>xtContext)
|
if (Cache^.WithVarExpr.Desc<>xtContext)
|
||||||
or (Cache^.WithVarExpr.Context.Node=nil)
|
or (Cache^.WithVarExpr.Context.Node=nil)
|
||||||
|
@ -161,7 +161,7 @@ type
|
|||||||
// instead return the variable declaration
|
// instead return the variable declaration
|
||||||
fdfFunctionResult, // if function is found, return result type
|
fdfFunctionResult, // if function is found, return result type
|
||||||
fdfEnumIdentifier, // do not resolve enum to its enum type
|
fdfEnumIdentifier, // do not resolve enum to its enum type
|
||||||
fdfFindChilds, // search the class of a 'class of', the interface of a unit
|
fdfFindChildren, // search the class of a 'class of', the interface of a unit
|
||||||
fdfSkipClassForward, // when a class forward was found search the class
|
fdfSkipClassForward, // when a class forward was found search the class
|
||||||
|
|
||||||
fdfCollect, // return every reachable identifier
|
fdfCollect, // return every reachable identifier
|
||||||
@ -1683,7 +1683,7 @@ begin
|
|||||||
if (Node=nil) or (Node.Desc<>ctnIdentifier) then exit;
|
if (Node=nil) or (Node.Desc<>ctnIdentifier) then exit;
|
||||||
|
|
||||||
// search enum type
|
// search enum type
|
||||||
Params.Flags:=[fdfExceptionOnNotFound,fdfSearchInParentNodes,fdfFindChilds];
|
Params.Flags:=[fdfExceptionOnNotFound,fdfSearchInParentNodes,fdfFindChildren];
|
||||||
Params.SetIdentifier(Self,@Context.Tool.Src[Node.StartPos],nil);
|
Params.SetIdentifier(Self,@Context.Tool.Src[Node.StartPos],nil);
|
||||||
Params.ContextNode:=Node;
|
Params.ContextNode:=Node;
|
||||||
if not Context.Tool.FindIdentifierInContext(Params) then exit;
|
if not Context.Tool.FindIdentifierInContext(Params) then exit;
|
||||||
@ -1722,7 +1722,7 @@ begin
|
|||||||
if IsLastProperty then
|
if IsLastProperty then
|
||||||
Params.Flags:=Params.Flags+[fdfFindVariable]
|
Params.Flags:=Params.Flags+[fdfFindVariable]
|
||||||
else
|
else
|
||||||
Params.Flags:=Params.Flags-[fdfFindVariable]+[fdfFunctionResult,fdfFindChilds];
|
Params.Flags:=Params.Flags-[fdfFindVariable]+[fdfFunctionResult,fdfFindChildren];
|
||||||
if not Context.Tool.FindIdentifierInContext(Params) then exit;
|
if not Context.Tool.FindIdentifierInContext(Params) then exit;
|
||||||
Context.Tool:=Params.NewCodeTool;
|
Context.Tool:=Params.NewCodeTool;
|
||||||
Context.Node:=Params.NewNode;
|
Context.Node:=Params.NewNode;
|
||||||
@ -2367,7 +2367,7 @@ begin
|
|||||||
ActivateGlobalWriteLock;
|
ActivateGlobalWriteLock;
|
||||||
Params:=TFindDeclarationParams.Create;
|
Params:=TFindDeclarationParams.Create;
|
||||||
try
|
try
|
||||||
Params.Flags:=Params.Flags+[fdfFunctionResult,fdfFindChilds];
|
Params.Flags:=Params.Flags+[fdfFunctionResult,fdfFindChildren];
|
||||||
FindContext:=FindBaseTypeOfNode(Params,ANode);
|
FindContext:=FindBaseTypeOfNode(Params,ANode);
|
||||||
if (FindContext.Node<>nil)
|
if (FindContext.Node<>nil)
|
||||||
and ((FindContext.Node.Desc in ([ctnEnumerationType]+AllClasses)))
|
and ((FindContext.Node.Desc in ([ctnEnumerationType]+AllClasses)))
|
||||||
@ -3707,7 +3707,7 @@ begin
|
|||||||
Result.Node:=Params.NewNode;
|
Result.Node:=Params.NewNode;
|
||||||
Params.Load(OldInput,true);
|
Params.Load(OldInput,true);
|
||||||
end else
|
end else
|
||||||
if (Result.Node.Desc=ctnClassOfType) and (fdfFindChilds in Params.Flags)
|
if (Result.Node.Desc=ctnClassOfType) and (fdfFindChildren in Params.Flags)
|
||||||
then begin
|
then begin
|
||||||
// this is a 'class of' type
|
// this is a 'class of' type
|
||||||
// -> search the real class
|
// -> search the real class
|
||||||
@ -4043,7 +4043,7 @@ begin
|
|||||||
Params.ContextNode:=WithNode;
|
Params.ContextNode:=WithNode;
|
||||||
Params.Flags:=[fdfExceptionOnNotFound,fdfSearchInAncestors,
|
Params.Flags:=[fdfExceptionOnNotFound,fdfSearchInAncestors,
|
||||||
fdfSearchInParentNodes,fdfFunctionResult,fdfIgnoreCurContextNode,
|
fdfSearchInParentNodes,fdfFunctionResult,fdfIgnoreCurContextNode,
|
||||||
fdfFindChilds];
|
fdfFindChildren];
|
||||||
ExprType:=FindExpressionResultType(Params,WithNode.StartPos,-1);
|
ExprType:=FindExpressionResultType(Params,WithNode.StartPos,-1);
|
||||||
if ExprType.Desc=xtContext then
|
if ExprType.Desc=xtContext then
|
||||||
AddFindContext(ListOfPFindContext,ExprType.Context);
|
AddFindContext(ListOfPFindContext,ExprType.Context);
|
||||||
@ -4263,7 +4263,7 @@ begin
|
|||||||
// search ancestor class context
|
// search ancestor class context
|
||||||
if FindClassContext then begin
|
if FindClassContext then begin
|
||||||
AncestorNode:=Params.NewNode;
|
AncestorNode:=Params.NewNode;
|
||||||
Params.Flags:=Params.Flags+[fdfFindChilds];
|
Params.Flags:=Params.Flags+[fdfFindChildren];
|
||||||
AncestorContext:=Params.NewCodeTool.FindBaseTypeOfNode(Params,
|
AncestorContext:=Params.NewCodeTool.FindBaseTypeOfNode(Params,
|
||||||
AncestorNode);
|
AncestorNode);
|
||||||
Params.SetResult(AncestorContext);
|
Params.SetResult(AncestorContext);
|
||||||
@ -5170,7 +5170,7 @@ begin
|
|||||||
Params.Save(OldInput);
|
Params.Save(OldInput);
|
||||||
Params.Flags:=[fdfIgnoreCurContextNode,fdfSearchInParentNodes]
|
Params.Flags:=[fdfIgnoreCurContextNode,fdfSearchInParentNodes]
|
||||||
+(fdfGlobals*Params.Flags)
|
+(fdfGlobals*Params.Flags)
|
||||||
+[fdfExceptionOnNotFound,fdfIgnoreUsedUnits,fdfFindChilds]
|
+[fdfExceptionOnNotFound,fdfIgnoreUsedUnits,fdfFindChildren]
|
||||||
-[fdfTopLvlResolving];
|
-[fdfTopLvlResolving];
|
||||||
Params.ContextNode:=ProcContextNode;
|
Params.ContextNode:=ProcContextNode;
|
||||||
Params.SetIdentifier(Self,@Src[ClassNameAtom.StartPos],nil);
|
Params.SetIdentifier(Self,@Src[ClassNameAtom.StartPos],nil);
|
||||||
@ -5268,7 +5268,7 @@ begin
|
|||||||
FindIdentifierInContext(Params);
|
FindIdentifierInContext(Params);
|
||||||
if FindClassContext then begin
|
if FindClassContext then begin
|
||||||
// parse class and return class node
|
// parse class and return class node
|
||||||
Params.Flags:=Params.Flags+[fdfFindChilds];
|
Params.Flags:=Params.Flags+[fdfFindChildren];
|
||||||
ClassContext:=FindBaseTypeOfNode(Params,Params.NewNode);
|
ClassContext:=FindBaseTypeOfNode(Params,Params.NewNode);
|
||||||
if (ClassContext.Node=nil)
|
if (ClassContext.Node=nil)
|
||||||
or (not (ClassContext.Node.Desc in AllClasses)) then begin
|
or (not (ClassContext.Node.Desc in AllClasses)) then begin
|
||||||
@ -5388,7 +5388,7 @@ begin
|
|||||||
// search ancestor class context
|
// search ancestor class context
|
||||||
if FindClassContext then begin
|
if FindClassContext then begin
|
||||||
AncestorNode:=Params.NewNode;
|
AncestorNode:=Params.NewNode;
|
||||||
Params.Flags:=Params.Flags+[fdfFindChilds];
|
Params.Flags:=Params.Flags+[fdfFindChildren];
|
||||||
AncestorContext:=Params.NewCodeTool.FindBaseTypeOfNode(Params,
|
AncestorContext:=Params.NewCodeTool.FindBaseTypeOfNode(Params,
|
||||||
AncestorNode);
|
AncestorNode);
|
||||||
Params.SetResult(AncestorContext);
|
Params.SetResult(AncestorContext);
|
||||||
@ -5532,7 +5532,7 @@ begin
|
|||||||
Params.Save(OldInput);
|
Params.Save(OldInput);
|
||||||
Params.ContextNode:=WithVarNode;
|
Params.ContextNode:=WithVarNode;
|
||||||
Params.Flags:=Params.Flags*fdfGlobals
|
Params.Flags:=Params.Flags*fdfGlobals
|
||||||
+[fdfExceptionOnNotFound,fdfFunctionResult,fdfFindChilds];
|
+[fdfExceptionOnNotFound,fdfFunctionResult,fdfFindChildren];
|
||||||
OldExtractedOperand:=Params.ExtractedOperand;
|
OldExtractedOperand:=Params.ExtractedOperand;
|
||||||
WithVarExpr:=FindExpressionTypeOfTerm(WithVarNode.StartPos,-1,Params,true);
|
WithVarExpr:=FindExpressionTypeOfTerm(WithVarNode.StartPos,-1,Params,true);
|
||||||
if fdfExtractOperand in Params.Flags then
|
if fdfExtractOperand in Params.Flags then
|
||||||
@ -6791,7 +6791,7 @@ var
|
|||||||
if AtEnd then CurAliasType:=AliasType;
|
if AtEnd then CurAliasType:=AliasType;
|
||||||
|
|
||||||
// find base type
|
// find base type
|
||||||
Params.Flags:=Params.Flags+[fdfEnumIdentifier]-[fdfFunctionResult,fdfFindChilds];
|
Params.Flags:=Params.Flags+[fdfEnumIdentifier]-[fdfFunctionResult,fdfFindChildren];
|
||||||
{$IFDEF ShowExprEval}
|
{$IFDEF ShowExprEval}
|
||||||
DebugLn([' FindExpressionTypeOfTerm ResolveBaseTypeOfIdentifier BEFORE ExprType=',ExprTypeToString(ExprType),' Alias=',CurAliasType<>nil]);
|
DebugLn([' FindExpressionTypeOfTerm ResolveBaseTypeOfIdentifier BEFORE ExprType=',ExprTypeToString(ExprType),' Alias=',CurAliasType<>nil]);
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
@ -6888,7 +6888,7 @@ var
|
|||||||
end;
|
end;
|
||||||
end else begin
|
end else begin
|
||||||
OldFlags:=Params.Flags;
|
OldFlags:=Params.Flags;
|
||||||
Params.Flags:=Params.Flags+[fdfFunctionResult,fdfFindChilds];
|
Params.Flags:=Params.Flags+[fdfFunctionResult,fdfFindChildren];
|
||||||
ExprType.Desc:=xtContext;
|
ExprType.Desc:=xtContext;
|
||||||
ExprType.Context:=FindBaseTypeOfNode(Params,ProcNode);
|
ExprType.Context:=FindBaseTypeOfNode(Params,ProcNode);
|
||||||
Params.Flags:=OldFlags;
|
Params.Flags:=OldFlags;
|
||||||
@ -7033,7 +7033,7 @@ var
|
|||||||
else if (ExprType.Context.Node.Desc=ctnClassOfType) then begin
|
else if (ExprType.Context.Node.Desc=ctnClassOfType) then begin
|
||||||
// 'class of' => jump to the class
|
// 'class of' => jump to the class
|
||||||
ExprType.Desc:=xtContext;
|
ExprType.Desc:=xtContext;
|
||||||
Params.Flags:=Params.Flags+[fdfFunctionResult,fdfFindChilds];
|
Params.Flags:=Params.Flags+[fdfFunctionResult,fdfFindChildren];
|
||||||
ExprType.Context:=ExprType.Context.Tool.FindBaseTypeOfNode(Params,
|
ExprType.Context:=ExprType.Context.Tool.FindBaseTypeOfNode(Params,
|
||||||
ExprType.Context.Node.FirstChild);
|
ExprType.Context.Node.FirstChild);
|
||||||
end
|
end
|
||||||
@ -7045,7 +7045,7 @@ var
|
|||||||
// left side of expression has defined a special context
|
// left side of expression has defined a special context
|
||||||
// => this '.' is a dereference
|
// => this '.' is a dereference
|
||||||
ExprType.Desc:=xtContext;
|
ExprType.Desc:=xtContext;
|
||||||
Params.Flags:=Params.Flags+[fdfFunctionResult,fdfFindChilds];
|
Params.Flags:=Params.Flags+[fdfFunctionResult,fdfFindChildren];
|
||||||
ExprType.Context:=ExprType.Context.Tool.FindBaseTypeOfNode(Params,
|
ExprType.Context:=ExprType.Context.Tool.FindBaseTypeOfNode(Params,
|
||||||
ExprType.Context.Node.FirstChild);
|
ExprType.Context.Node.FirstChild);
|
||||||
end;
|
end;
|
||||||
@ -7208,7 +7208,7 @@ var
|
|||||||
// => search 'TVarRec'
|
// => search 'TVarRec'
|
||||||
Params.Save(OldInput);
|
Params.Save(OldInput);
|
||||||
Params.Flags:=[fdfSearchInParentNodes,fdfIgnoreCurContextNode,
|
Params.Flags:=[fdfSearchInParentNodes,fdfIgnoreCurContextNode,
|
||||||
fdfExceptionOnNotFound,fdfFindChilds];
|
fdfExceptionOnNotFound,fdfFindChildren];
|
||||||
// special identifier for TVarRec
|
// special identifier for TVarRec
|
||||||
Params.SetIdentifier(Self,'tvarrec',nil);
|
Params.SetIdentifier(Self,'tvarrec',nil);
|
||||||
Params.ContextNode:=ExprType.Context.Node;
|
Params.ContextNode:=ExprType.Context.Node;
|
||||||
@ -7403,7 +7403,7 @@ var
|
|||||||
ExprType.Context:=CreateFindContext(Params);
|
ExprType.Context:=CreateFindContext(Params);
|
||||||
if (not HasIdentifier) then begin
|
if (not HasIdentifier) then begin
|
||||||
// the keyword 'inherited' is the last atom
|
// the keyword 'inherited' is the last atom
|
||||||
if StartFlags*[fdfFindChilds,fdfFindVariable]=[fdfFindVariable] then begin
|
if StartFlags*[fdfFindChildren,fdfFindVariable]=[fdfFindVariable] then begin
|
||||||
// for example: inherited; search the method, not the context
|
// for example: inherited; search the method, not the context
|
||||||
DefProcNode:=FindCorrespondingProcNode(ProcNode);
|
DefProcNode:=FindCorrespondingProcNode(ProcNode);
|
||||||
if DefProcNode=nil then begin
|
if DefProcNode=nil then begin
|
||||||
|
Loading…
Reference in New Issue
Block a user