mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-10-30 21:21:30 +01:00
codetools: implemented modeswitch externalclass
git-svn-id: trunk@54470 -
This commit is contained in:
parent
6dd5585619
commit
d5881ef02e
@ -8935,6 +8935,13 @@ begin
|
|||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
exit(true);
|
exit(true);
|
||||||
end;
|
end;
|
||||||
|
if FindClassExternalNode(CodeCompleteClassNode)<>nil then begin
|
||||||
|
// external class has no implementations
|
||||||
|
{$IF defined(CTDEBUG) or defined(VerboseCreateMissingClassProcBodies)}
|
||||||
|
debugln(['TCodeCompletionCodeTool.CreateMissingClassProcBodies external ',CodeCompleteClassNode.DescAsString]);
|
||||||
|
{$ENDIF}
|
||||||
|
exit(true);
|
||||||
|
end;
|
||||||
|
|
||||||
Result:=false;
|
Result:=false;
|
||||||
Beauty:=FSourceChangeCache.BeautifyCodeOptions;
|
Beauty:=FSourceChangeCache.BeautifyCodeOptions;
|
||||||
|
|||||||
@ -195,7 +195,8 @@ type
|
|||||||
cmsDefault_unicodestring, { makes the default string type in $h+ mode unicodestring rather than
|
cmsDefault_unicodestring, { makes the default string type in $h+ mode unicodestring rather than
|
||||||
ansistring; similarly, char becomes unicodechar rather than ansichar }
|
ansistring; similarly, char becomes unicodechar rather than ansichar }
|
||||||
cmsTypeHelpers,
|
cmsTypeHelpers,
|
||||||
cmsBlocks
|
cmsBlocks,
|
||||||
|
cmsExternalClass { allow class external [pkgname] name [symbol] }
|
||||||
);
|
);
|
||||||
TCompilerModeSwitches = set of TCompilerModeSwitch;
|
TCompilerModeSwitches = set of TCompilerModeSwitch;
|
||||||
const
|
const
|
||||||
@ -797,7 +798,8 @@ const
|
|||||||
'FINALFIELDS',
|
'FINALFIELDS',
|
||||||
'UNICODESTRINGS',
|
'UNICODESTRINGS',
|
||||||
'TYPEHELPERS',
|
'TYPEHELPERS',
|
||||||
'BLOCKS'
|
'BLOCKS',
|
||||||
|
'EXTERNALCLASS'
|
||||||
);
|
);
|
||||||
|
|
||||||
// upper case
|
// upper case
|
||||||
|
|||||||
@ -4359,9 +4359,11 @@ begin
|
|||||||
end;
|
end;
|
||||||
if UpAtomIs('EXTERNAL') then begin
|
if UpAtomIs('EXTERNAL') then begin
|
||||||
if (ClassDesc in [ctnObjCClass,ctnObjCCategory])
|
if (ClassDesc in [ctnObjCClass,ctnObjCCategory])
|
||||||
|
or (cmsExternalClass in Scanner.CompilerModeSwitches)
|
||||||
or Scanner.Values.IsDefined('CPUJVM') then begin
|
or Scanner.Values.IsDefined('CPUJVM') then begin
|
||||||
// objcclass external [name '']
|
// objcclass external [name '']
|
||||||
// cpujvm: class external '' [name '']
|
// cpujvm: class external '' [name '']
|
||||||
|
// externalclass: class external [''] name ''
|
||||||
CreateChildNode;
|
CreateChildNode;
|
||||||
CurNode.Desc:=ctnClassExternal;
|
CurNode.Desc:=ctnClassExternal;
|
||||||
ReadNextAtom;
|
ReadNextAtom;
|
||||||
|
|||||||
@ -225,6 +225,7 @@ type
|
|||||||
function IsClassNode(Node: TCodeTreeNode): boolean; // class, not object
|
function IsClassNode(Node: TCodeTreeNode): boolean; // class, not object
|
||||||
function FindInheritanceNode(ClassNode: TCodeTreeNode): TCodeTreeNode;
|
function FindInheritanceNode(ClassNode: TCodeTreeNode): TCodeTreeNode;
|
||||||
function FindHelperForNode(HelperNode: TCodeTreeNode): TCodeTreeNode;
|
function FindHelperForNode(HelperNode: TCodeTreeNode): TCodeTreeNode;
|
||||||
|
function FindClassExternalNode(ClassNode: TCodeTreeNode): TCodeTreeNode;
|
||||||
function IdentNodeIsInVisibleClassSection(Node: TCodeTreeNode; Visibility: TClassSectionVisibility): Boolean;
|
function IdentNodeIsInVisibleClassSection(Node: TCodeTreeNode; Visibility: TClassSectionVisibility): Boolean;
|
||||||
|
|
||||||
// records
|
// records
|
||||||
@ -3066,6 +3067,19 @@ begin
|
|||||||
Result:=nil;
|
Result:=nil;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TPascalReaderTool.FindClassExternalNode(ClassNode: TCodeTreeNode
|
||||||
|
): TCodeTreeNode;
|
||||||
|
begin
|
||||||
|
if ClassNode=nil then exit;
|
||||||
|
Result:=ClassNode.FirstChild;
|
||||||
|
while (Result<>nil) do
|
||||||
|
begin
|
||||||
|
if Result.Desc=ctnClassExternal then exit;
|
||||||
|
if Result.Desc in AllClassBaseSections then exit(nil);
|
||||||
|
Result:=Result.NextBrother;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
function TPascalReaderTool.FindTypeOfForwardNode(TypeNode: TCodeTreeNode
|
function TPascalReaderTool.FindTypeOfForwardNode(TypeNode: TCodeTreeNode
|
||||||
): TCodeTreeNode;
|
): TCodeTreeNode;
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user