mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-23 18:20:00 +02:00
codetools: modeswitch objectivec1,2: check keywords objcclass,category,protocol only in this mode switch, fixed finding NSObject, hack for searching objccategory removed
git-svn-id: trunk@49641 -
This commit is contained in:
parent
e5f6bc622c
commit
bb5f1d11a6
@ -96,7 +96,7 @@ const
|
||||
|
||||
ctnClassAbstract = 40;
|
||||
ctnClassSealed = 41;
|
||||
ctnClassExternal = 42;
|
||||
ctnClassExternal = 42; // parent: jvm: ctnClass, ObjCClass, ObjCProtocol
|
||||
ctnClassHelper = 43;//"class helper"
|
||||
ctnClassInheritance = 44;
|
||||
ctnHelperFor = 45;//class/record/type helper for
|
||||
@ -106,8 +106,8 @@ const
|
||||
ctnClassProtected = 49;
|
||||
ctnClassPublic = 50;
|
||||
ctnClassPublished = 51;
|
||||
ctnClassRequired = 52;
|
||||
ctnClassOptional = 53;
|
||||
ctnClassRequired = 52; // parent: ObjCProtocol
|
||||
ctnClassOptional = 53; // parent: ObjCProtocol
|
||||
ctnProperty = 54; // child of visibility section or AllClassInterfaces
|
||||
ctnMethodMap = 55; // child of visibility section or AllClassInterfaces
|
||||
|
||||
|
@ -3313,14 +3313,6 @@ var
|
||||
if ContextNode.Desc=ctnGenericType then begin
|
||||
NameNode:=ContextNode.FirstChild;
|
||||
if NameNode=nil then exit;
|
||||
end else
|
||||
if (ContextNode.Desc=ctnTypeDefinition)
|
||||
and Assigned(ContextNode.FirstChild)
|
||||
and (ContextNode.FirstChild.Desc=ctnObjCCategory) then begin
|
||||
NameNode:=FindInheritanceNode(ContextNode.FirstChild);
|
||||
if NameNode=nil then exit;
|
||||
NameNode:=NameNode.FirstChild;
|
||||
if NameNode=nil then exit;
|
||||
end;
|
||||
|
||||
if (fdfCollect in Flags)
|
||||
@ -7042,27 +7034,6 @@ function TFindDeclarationTool.BuildInterfaceIdentifierCache(
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure ScanForExtendedClass(ParentNode: TCodeTreeNode);
|
||||
var
|
||||
Node: TCodeTreeNode;
|
||||
begin
|
||||
Node:=ParentNode.FirstChild;
|
||||
if (Node<>nil) then
|
||||
case Node.Desc of
|
||||
ctnObjCCategory:
|
||||
begin
|
||||
Node:=FindInheritanceNode(Node);
|
||||
if Assigned(Node) then begin
|
||||
Node:=Node.FirstChild;
|
||||
if Assigned(Node) then
|
||||
FInterfaceIdentifierCache.Add(@Src[Node.StartPos],
|
||||
ParentNode,ParentNode.StartPos);
|
||||
end;
|
||||
end;
|
||||
{ TODO : class helpers }
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure ScanChildren(ParentNode: TCodeTreeNode); forward;
|
||||
|
||||
procedure ScanNode(Node: TCodeTreeNode);
|
||||
@ -7074,7 +7045,6 @@ function TFindDeclarationTool.BuildInterfaceIdentifierCache(
|
||||
begin
|
||||
FInterfaceIdentifierCache.Add(@Src[Node.StartPos],Node,Node.StartPos);
|
||||
ScanForEnums(Node);
|
||||
ScanForExtendedClass(Node);
|
||||
if (Node.Desc = ctnTypeDefinition) and
|
||||
Assigned(Node.FirstChild) and (Node.FirstChild.Desc in [ctnClassHelper, ctnRecordHelper, ctnTypeHelper])
|
||||
then
|
||||
|
@ -412,12 +412,19 @@ begin
|
||||
'L':
|
||||
if CompareSrcIdentifiers('LABEL',p) then exit(KeyWordFuncTypeLabel);
|
||||
'O':
|
||||
if CompareSrcIdentifiers('OBJECT',p)
|
||||
or CompareSrcIdentifiers('OBJCCLASS',p)
|
||||
or CompareSrcIdentifiers('OBJCCATEGORY',p) then
|
||||
exit(KeyWordFuncTypeClass)
|
||||
else if CompareSrcIdentifiers('OBJCPROTOCOL',p) then
|
||||
exit(KeyWordFuncTypeClassInterface(ctnObjCProtocol));
|
||||
begin
|
||||
if CompareSrcIdentifiers('OBJECT',p) then
|
||||
exit(KeyWordFuncTypeClass);
|
||||
if (UpChars[p[1]]='B') and (UpChars[p[2]]='J') and (UpChars[p[3]]='C')
|
||||
and (Scanner.CompilerModeSwitches*[cmsObjectiveC1,cmsObjectiveC2]<>[])
|
||||
then begin
|
||||
if CompareSrcIdentifiers('OBJCCLASS',p)
|
||||
or CompareSrcIdentifiers('OBJCCATEGORY',p) then
|
||||
exit(KeyWordFuncTypeClass)
|
||||
else if CompareSrcIdentifiers('OBJCPROTOCOL',p) then
|
||||
exit(KeyWordFuncTypeClassInterface(ctnObjCProtocol));
|
||||
end;
|
||||
end;
|
||||
'P':
|
||||
case UpChars[p[1]] of
|
||||
'A': if CompareSrcIdentifiers('PACKED',p) then exit(KeyWordFuncTypePacked);
|
||||
@ -4114,6 +4121,8 @@ begin
|
||||
if UpAtomIs('EXTERNAL') then begin
|
||||
IsJVM:=Scanner.Values.IsDefined('CPUJVM');
|
||||
if IsJVM or (IntfDesc=ctnObjCProtocol) then begin
|
||||
// objcprotocol external [name '']
|
||||
// cpujvm: class external '' [name '']
|
||||
CreateChildNode;
|
||||
CurNode.Desc:=ctnClassExternal;
|
||||
ReadNextAtom;
|
||||
@ -5187,7 +5196,7 @@ begin
|
||||
if (ExtractSearchPos>0)
|
||||
and (ExtractSearchPos<=ExtractMemStream.Position)
|
||||
then begin
|
||||
ExtractFoundPos:=ExtractSearchPos-1-LastStreamPos+CurPos.StartPos;
|
||||
ExtractFoundPos:=ExtractSearchPos-1-integer(LastStreamPos)+CurPos.StartPos;
|
||||
ExtractSearchPos:=-1;
|
||||
end;
|
||||
ReadNextAtom;
|
||||
|
Loading…
Reference in New Issue
Block a user