mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-06-01 18:32:39 +02: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}
|
||||
exit(true);
|
||||
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;
|
||||
Beauty:=FSourceChangeCache.BeautifyCodeOptions;
|
||||
|
@ -195,7 +195,8 @@ type
|
||||
cmsDefault_unicodestring, { makes the default string type in $h+ mode unicodestring rather than
|
||||
ansistring; similarly, char becomes unicodechar rather than ansichar }
|
||||
cmsTypeHelpers,
|
||||
cmsBlocks
|
||||
cmsBlocks,
|
||||
cmsExternalClass { allow class external [pkgname] name [symbol] }
|
||||
);
|
||||
TCompilerModeSwitches = set of TCompilerModeSwitch;
|
||||
const
|
||||
@ -797,7 +798,8 @@ const
|
||||
'FINALFIELDS',
|
||||
'UNICODESTRINGS',
|
||||
'TYPEHELPERS',
|
||||
'BLOCKS'
|
||||
'BLOCKS',
|
||||
'EXTERNALCLASS'
|
||||
);
|
||||
|
||||
// upper case
|
||||
|
@ -4359,9 +4359,11 @@ begin
|
||||
end;
|
||||
if UpAtomIs('EXTERNAL') then begin
|
||||
if (ClassDesc in [ctnObjCClass,ctnObjCCategory])
|
||||
or (cmsExternalClass in Scanner.CompilerModeSwitches)
|
||||
or Scanner.Values.IsDefined('CPUJVM') then begin
|
||||
// objcclass external [name '']
|
||||
// cpujvm: class external '' [name '']
|
||||
// externalclass: class external [''] name ''
|
||||
CreateChildNode;
|
||||
CurNode.Desc:=ctnClassExternal;
|
||||
ReadNextAtom;
|
||||
|
@ -225,6 +225,7 @@ type
|
||||
function IsClassNode(Node: TCodeTreeNode): boolean; // class, not object
|
||||
function FindInheritanceNode(ClassNode: TCodeTreeNode): TCodeTreeNode;
|
||||
function FindHelperForNode(HelperNode: TCodeTreeNode): TCodeTreeNode;
|
||||
function FindClassExternalNode(ClassNode: TCodeTreeNode): TCodeTreeNode;
|
||||
function IdentNodeIsInVisibleClassSection(Node: TCodeTreeNode; Visibility: TClassSectionVisibility): Boolean;
|
||||
|
||||
// records
|
||||
@ -3066,6 +3067,19 @@ begin
|
||||
Result:=nil;
|
||||
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
|
||||
): TCodeTreeNode;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user