codetools: distinct dispinterface and other interfaces

git-svn-id: trunk@23500 -
This commit is contained in:
paul 2010-01-20 13:18:11 +00:00
parent 9d62f8913b
commit 9e02d5824f
8 changed files with 18 additions and 15 deletions

View File

@ -4623,7 +4623,7 @@ function TCodeCompletionCodeTool.BuildUnitDefinitionGraph(out
end;
end;
ctnRecordType, ctnClassInterface, ctnClass, ctnObject,
ctnRecordType, ctnClassInterface, ctnDispinterface, ctnClass, ctnObject,
ctnObjCClass, ctnObjCCategory, ctnObjCProtocol, ctnCPPClass:
begin
ChildNode:=SubNode.FirstChild;

View File

@ -87,6 +87,7 @@ const
ctnObjCCategory = 34;
ctnObjCProtocol = 35;
ctnCPPClass = 36;
ctnDispinterface = 37;
ctnClassAbstract = 40;
ctnClassSealed = 41;
@ -165,10 +166,10 @@ const
AllClassSections =
AllClassBaseSections+AllClassTypeSections+AllClassVarSections;
AllClasses =
[ctnClass,ctnClassInterface,ctnObject,
[ctnClass,ctnClassInterface,ctnDispinterface,ctnObject,
ctnObjCClass,ctnObjCCategory,ctnObjCProtocol,
ctnCPPClass];
AllClassInterfaces = [ctnClassInterface,ctnObjCProtocol];
AllClassInterfaces = [ctnClassInterface,ctnDispinterface,ctnObjCProtocol];
AllClassObjects = [ctnClass,ctnObject,ctnObjCClass,ctnObjCCategory,ctnCPPClass];
AllClassModifiers = [ctnClassAbstract, ctnClassSealed];
AllDefinitionSections =
@ -367,6 +368,7 @@ begin
ctnClass: Result:='Class';
ctnClassInterface: Result:='Class Interface';
ctnDispinterface: Result:='Dispinterface';
ctnObject: Result:='Object';
ctnObjCClass: Result:='ObjCClass';
ctnObjCCategory: Result:='ObjCCategory';

View File

@ -540,7 +540,7 @@ begin
if (SubDesc and ctnsNeedJITParsing)>0 then Result:=ctsUnparsed;
end;
ctnClass,ctnObject,ctnObjCClass,ctnObjCCategory,ctnObjCProtocol,
ctnCPPClass,ctnClassInterface:
ctnCPPClass,ctnClassInterface,ctnDispinterface:
begin
Result:='';
if (SubDesc and ctnsForwardDeclaration)>0 then Result:=ctsForward;

View File

@ -2110,7 +2110,7 @@ begin
TypeNode:=NewTool.FindTypeNodeOfDefinition(NewNode);
if TypeNode<>nil then begin
case TypeNode.Desc of
ctnIdentifier, ctnClass, ctnClassInterface, ctnObject,
ctnIdentifier, ctnClass, ctnClassInterface, ctnDispinterface, ctnObject,
ctnObjCClass, ctnObjCCategory, ctnObjCProtocol, ctnCPPClass:
begin
NewTool.MoveCursorToNodeStart(TypeNode);
@ -2871,7 +2871,7 @@ var
// of the prior node
;
ctnClass, ctnClassInterface, ctnObject,
ctnClass, ctnClassInterface, ctnDispinterface, ctnObject,
ctnObjCClass, ctnObjCCategory, ctnObjCProtocol, ctnCPPClass,
ctnRecordType, ctnRecordCase:
// do not search again in this node, go on ...
@ -2981,7 +2981,7 @@ begin
ctnClassPublic, ctnClassPrivate, ctnClassProtected, ctnClassPublished,
ctnClassTypePublished,ctnClassTypePublic,ctnClassTypeProtected,ctnClassTypePrivate,
ctnClassVarPublished,ctnClassVarPublic,ctnClassVarProtected,ctnClassVarPrivate,
ctnClass, ctnClassInterface, ctnObject,
ctnClass, ctnClassInterface, ctnDispinterface, ctnObject,
ctnObjCClass, ctnObjCCategory, ctnObjCProtocol, ctnCPPClass,
ctnRecordType, ctnRecordVariant,
ctnParameterList:
@ -6516,7 +6516,7 @@ var
ExprType.Context:=ExprType.Context.Tool.FindBaseTypeOfNode(Params,
ExprType.Context.Node.FirstChild);
ctnClass, ctnClassInterface, ctnObject,
ctnClass, ctnClassInterface, ctnDispinterface, ctnObject,
ctnObjCClass, ctnObjCCategory, ctnObjCProtocol, ctnCPPClass,
ctnProperty, ctnGlobalProperty:
begin
@ -8029,7 +8029,7 @@ begin
// same context type
case ExprNode.Desc of
ctnClass,ctnClassInterface, ctnObject,
ctnClass, ctnClassInterface, ctnDispinterface, ctnObject,
ctnObjCClass, ctnObjCCategory, ctnObjCProtocol, ctnCPPClass:
// check, if ExpressionType.Context is descend of TargetContext
if ContextIsDescendOf(ExpressionType.Context,
@ -9563,7 +9563,7 @@ begin
Result:=GetIdentifier(@FindContext.Tool.Src[ANode.StartPos]);
end;
ctnClass, ctnClassInterface, ctnObject,
ctnClass, ctnClassInterface, ctnDispinterface, ctnObject,
ctnObjCClass, ctnObjCCategory, ctnObjCProtocol, ctnCPPClass:
if (FindContext.Node.Parent<>nil)
and (FindContext.Node.Parent.Desc in [ctnTypeDefinition,ctnGenericType])

View File

@ -1497,7 +1497,7 @@ begin
Add('destructor');
end;
ctnClassInterface,ctnObjCProtocol,ctnCPPClass:
ctnClassInterface,ctnDispinterface,ctnObjCProtocol,ctnCPPClass:
begin
Add('procedure');
Add('function');

View File

@ -1149,7 +1149,6 @@ begin
with PackedTypesKeyWordFuncList do begin
Add('CLASS',{$ifdef FPC}@{$endif}AllwaysTrue);
Add('OBJECT',{$ifdef FPC}@{$endif}AllwaysTrue);
Add('DISPINTERFACE',{$ifdef FPC}@{$endif}AllwaysTrue);
Add('ARRAY',{$ifdef FPC}@{$endif}AllwaysTrue);
Add('SET',{$ifdef FPC}@{$endif}AllwaysTrue);
Add('RECORD',{$ifdef FPC}@{$endif}AllwaysTrue);
@ -1160,7 +1159,6 @@ begin
with BitPackedTypesKeyWordFuncList do begin
Add('CLASS',{$ifdef FPC}@{$endif}AllwaysTrue);
Add('OBJECT',{$ifdef FPC}@{$endif}AllwaysTrue);
Add('DISPINTERFACE',{$ifdef FPC}@{$endif}AllwaysTrue);
Add('ARRAY',{$ifdef FPC}@{$endif}AllwaysTrue);
Add('SET',{$ifdef FPC}@{$endif}AllwaysTrue);
Add('RECORD',{$ifdef FPC}@{$endif}AllwaysTrue);

View File

@ -3567,6 +3567,9 @@ begin
ChildCreated:=true; // maybe change this in future to jit parsing
if UpAtomIs('INTERFACE') then
IntfDesc:=ctnClassInterface
else
if UpAtomIs('DISPINTERFACE') then
IntfDesc:=ctnDispinterface
else
IntfDesc:=ctnObjCProtocol;
if ChildCreated then begin
@ -4658,7 +4661,7 @@ procedure TPascalParserTool.BuildSubTree(ANode: TCodeTreeNode);
begin
if ANode=nil then exit;
case ANode.Desc of
ctnClass,ctnClassInterface,ctnObject,
ctnClass,ctnClassInterface,ctnDispinterface,ctnObject,
ctnObjCClass,ctnObjCCategory,ctnObjCProtocol,ctnCPPClass:
BuildSubTreeForClass(ANode);
ctnProcedure,ctnProcedureHead:

View File

@ -6614,7 +6614,7 @@ begin
Node:=Tree.Root;
while Node<>nil do begin
case Node.Desc of
ctnClass,ctnClassInterface,ctnObject,
ctnClass,ctnClassInterface,ctnDispinterface,ctnObject,
ctnObjCClass,ctnObjCCategory,ctnObjCProtocol,ctnCPPClass:
BuildSubTreeForClass(Node);
ctnProcedure,ctnProcedureHead: