mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-06 15:41:45 +02:00
codetools: changed CompielrModeSwitch to set
git-svn-id: trunk@30698 -
This commit is contained in:
parent
fbca65edab
commit
557c962f0c
@ -1932,7 +1932,7 @@ begin
|
||||
or ((Scanner.CompilerMode=cmMacPas)
|
||||
and (Scanner.PascalCompiler=pcFPC)
|
||||
and (CompareIdentifiers(PChar(Result),'MacPas')=0))
|
||||
or ((Scanner.CompilerModeSwitch=cmsObjectiveC1)
|
||||
or ((cmsObjectiveC1 in Scanner.CompilerModeSwitches)
|
||||
and ((CompareIdentifiers(PChar(Result),'ObjC')=0)
|
||||
or (CompareIdentifiers(PChar(Result),'ObjCBase')=0)))
|
||||
then begin
|
||||
@ -6204,13 +6204,13 @@ begin
|
||||
if Result and Params.IsFinal then exit;
|
||||
end;
|
||||
if (CurUnitType>sutObjCBase)
|
||||
and (Scanner.CompilerModeSwitch=cmsObjectiveC1) then begin
|
||||
and (cmsObjectiveC1 in Scanner.CompilerModeSwitches) then begin
|
||||
// try hidden used fpc unit 'objcbase'
|
||||
Result:=FindIdentifierInUsedUnit('ObjCBase',Params);
|
||||
if Result and Params.IsFinal then exit;
|
||||
end;
|
||||
if (CurUnitType>sutObjC)
|
||||
and (Scanner.CompilerModeSwitch=cmsObjectiveC1) then begin
|
||||
and (cmsObjectiveC1 in Scanner.CompilerModeSwitches) then begin
|
||||
// try hidden used fpc unit 'objc'
|
||||
Result:=FindIdentifierInUsedUnit('ObjC',Params);
|
||||
if Result and Params.IsFinal then exit;
|
||||
|
@ -1362,7 +1362,7 @@ begin
|
||||
if (Scanner.CompilerMode=cmMacPas)
|
||||
and (Scanner.PascalCompiler=pcFPC) then
|
||||
AddSystemUnit('MacPas');
|
||||
if (Scanner.CompilerModeSwitch=cmsObjectiveC1) then begin
|
||||
if (cmsObjectiveC1 in Scanner.CompilerModeSwitches) then begin
|
||||
AddSystemUnit('ObjC');
|
||||
AddSystemUnit('ObjCBase');
|
||||
end;
|
||||
|
@ -132,8 +132,7 @@ type
|
||||
|
||||
TCompilerMode = (cmFPC, cmDELPHI, cmGPC, cmTP, cmOBJFPC, cmMacPas, cmISO);
|
||||
TCompilerModeSwitch = (
|
||||
cmsDefault,
|
||||
cmsClass,
|
||||
cmsClass,
|
||||
cmsObjpas,
|
||||
cmsResult,
|
||||
cmsString_pchar,
|
||||
@ -160,6 +159,7 @@ type
|
||||
cmsNonLocalGoto,
|
||||
cmsAdvancedRecords
|
||||
);
|
||||
TCompilerModeSwitches = set of TCompilerModeSwitch;
|
||||
|
||||
TPascalCompiler = (pcFPC, pcDelphi);
|
||||
|
||||
@ -327,12 +327,11 @@ type
|
||||
FSkippingDirectives: TLSSkippingDirective;
|
||||
FSkipIfLevel: integer;
|
||||
FCompilerMode: TCompilerMode;
|
||||
FCompilerModeSwitch: TCompilerModeSwitch;
|
||||
FCompilerModeSwitches: TCompilerModeSwitches;
|
||||
FPascalCompiler: TPascalCompiler;
|
||||
FMacros: PSourceLinkMacro;
|
||||
FMacroCount, fMacroCapacity: integer;
|
||||
procedure SetCompilerMode(const AValue: TCompilerMode);
|
||||
procedure SetCompilerModeSwitch(const AValue: TCompilerModeSwitch);
|
||||
procedure SkipTillEndifElse(SkippingUntil: TLSSkippingDirective);
|
||||
function InternalIfDirective: boolean;
|
||||
|
||||
@ -497,8 +496,8 @@ type
|
||||
property NestedComments: boolean read FNestedComments;
|
||||
property CompilerMode: TCompilerMode
|
||||
read FCompilerMode write SetCompilerMode;
|
||||
property CompilerModeSwitch: TCompilerModeSwitch
|
||||
read FCompilerModeSwitch write SetCompilerModeSwitch;
|
||||
property CompilerModeSwitches: TCompilerModeSwitches
|
||||
read FCompilerModeSwitches write FCompilerModeSwitches;
|
||||
property PascalCompiler: TPascalCompiler
|
||||
read FPascalCompiler write FPascalCompiler;
|
||||
property ScanTill: TLinkScannerRange read FScanTill write SetScanTill;
|
||||
@ -537,7 +536,7 @@ const
|
||||
);
|
||||
|
||||
CompilerModeSwitchNames: array[TCompilerModeSwitch] of shortstring=(
|
||||
'Default', 'CLASS', 'OBJPAS', 'RESULT', 'PCHARTOSTRING', 'CVAR',
|
||||
'CLASS', 'OBJPAS', 'RESULT', 'PCHARTOSTRING', 'CVAR',
|
||||
'NESTEDCOMMENTS', 'CLASSICPROCVARS', 'MACPROCVARS', 'REPEATFORWARD',
|
||||
'POINTERTOPROCVAR', 'AUTODEREF', 'INITFINAL', 'POINTERARITHMETICS',
|
||||
'ANSISTRINGS', 'OUT', 'DEFAULTPARAMETERS', 'HINTDIRECTIVE',
|
||||
@ -2519,12 +2518,14 @@ begin
|
||||
if CompareUpToken(CompilerModeSwitchNames[ModeSwitch],Src,ValStart,SrcPos)
|
||||
then begin
|
||||
Result:=true;
|
||||
CompilerModeSwitch:=ModeSwitch;
|
||||
break;
|
||||
if (SrcPos<=SrcLen) and (Src[SrcPos]='-') then
|
||||
Exclude(FCompilerModeSwitches,ModeSwitch)
|
||||
else
|
||||
Include(FCompilerModeSwitches,ModeSwitch);
|
||||
exit;
|
||||
end;
|
||||
end;
|
||||
if not Result then
|
||||
RaiseExceptionFmt(ctsInvalidModeSwitch,[copy(Src,ValStart,SrcPos-ValStart)]);
|
||||
RaiseExceptionFmt(ctsInvalidModeSwitch,[copy(Src,ValStart,SrcPos-ValStart)]);
|
||||
end;
|
||||
|
||||
function TLinkScanner.ThreadingDirective: boolean;
|
||||
@ -3545,7 +3546,7 @@ begin
|
||||
FCompilerMode:=AValue;
|
||||
FNestedComments:=(PascalCompiler=pcFPC)
|
||||
and (FCompilerMode in [cmFPC,cmOBJFPC]);
|
||||
FCompilerModeSwitch:=cmsDefault;
|
||||
FCompilerModeSwitches:=[];
|
||||
end;
|
||||
|
||||
function TLinkScanner.GetIgnoreMissingIncludeFiles: boolean;
|
||||
@ -3553,12 +3554,6 @@ begin
|
||||
Result:=lssIgnoreMissingIncludeFiles in FStates;
|
||||
end;
|
||||
|
||||
procedure TLinkScanner.SetCompilerModeSwitch(const AValue: TCompilerModeSwitch);
|
||||
begin
|
||||
if FCompilerModeSwitch=AValue then exit;
|
||||
FCompilerModeSwitch:=AValue;
|
||||
end;
|
||||
|
||||
function TLinkScanner.InternalIfDirective: boolean;
|
||||
// {$if expression} or {$ifc expression} or indirectly called by {$elifc expression}
|
||||
var
|
||||
|
@ -131,7 +131,7 @@ type
|
||||
protected
|
||||
// parsing
|
||||
FLastCompilerMode: TCompilerMode;
|
||||
FLastCompilerModeSwitch: TCompilerModeSwitch;
|
||||
FLastCompilerModeSwitches: TCompilerModeSwitches;
|
||||
procedure FetchScannerSource(Range: TLinkScannerRange); override;
|
||||
// sections
|
||||
function KeyWordFuncSection: boolean;
|
||||
@ -4532,9 +4532,9 @@ begin
|
||||
//debugln(['TPascalParserTool.FetchScannerSource link scanner has changed ',MainFilename]);
|
||||
FLastScannerChangeStep:=Scanner.ChangeStep;
|
||||
AllChanged:=(FLastCompilerMode<>Scanner.CompilerMode)
|
||||
or (FLastCompilerModeSwitch<>Scanner.CompilerModeSwitch);
|
||||
or (FLastCompilerModeSwitches<>Scanner.CompilerModeSwitches);
|
||||
FLastCompilerMode:=Scanner.CompilerMode;
|
||||
FLastCompilerModeSwitch:=Scanner.CompilerModeSwitch;
|
||||
FLastCompilerModeSwitches:=Scanner.CompilerModeSwitches;
|
||||
NewSrc:=Scanner.CleanedSrc;
|
||||
NewSrcLen:=length(NewSrc);
|
||||
if AllChanged then begin
|
||||
|
Loading…
Reference in New Issue
Block a user