|
@@ -4388,7 +4388,7 @@ function TPascalScanner.HandleDirective(const ADirectiveText: String): TToken;
|
|
Var
|
|
Var
|
|
Directive,Param : String;
|
|
Directive,Param : String;
|
|
P : Integer;
|
|
P : Integer;
|
|
- Handled: Boolean;
|
|
|
|
|
|
+ IsFlowControl,Handled: Boolean;
|
|
|
|
|
|
procedure DoBoolDirective(bs: TBoolSwitch);
|
|
procedure DoBoolDirective(bs: TBoolSwitch);
|
|
begin
|
|
begin
|
|
@@ -4416,7 +4416,8 @@ begin
|
|
{$IFDEF VerbosePasDirectiveEval}
|
|
{$IFDEF VerbosePasDirectiveEval}
|
|
Writeln('TPascalScanner.HandleDirective.Directive: "',Directive,'", Param : "',Param,'"');
|
|
Writeln('TPascalScanner.HandleDirective.Directive: "',Directive,'", Param : "',Param,'"');
|
|
{$ENDIF}
|
|
{$ENDIF}
|
|
-
|
|
|
|
|
|
+ Handled:=true;
|
|
|
|
+ IsFlowControl:=True;
|
|
Case UpperCase(Directive) of
|
|
Case UpperCase(Directive) of
|
|
'IFDEF':
|
|
'IFDEF':
|
|
HandleIFDEF(Param);
|
|
HandleIFDEF(Param);
|
|
@@ -4440,7 +4441,7 @@ begin
|
|
HandleENDIF(Param);
|
|
HandleENDIF(Param);
|
|
else
|
|
else
|
|
if PPIsSkipping then exit;
|
|
if PPIsSkipping then exit;
|
|
-
|
|
|
|
|
|
+ IsFlowControl:=False;
|
|
Handled:=false;
|
|
Handled:=false;
|
|
if (length(Directive)=2)
|
|
if (length(Directive)=2)
|
|
and (Directive[1] in ['a'..'z','A'..'Z'])
|
|
and (Directive[1] in ['a'..'z','A'..'Z'])
|
|
@@ -4540,13 +4541,12 @@ begin
|
|
Handled:=false;
|
|
Handled:=false;
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
-
|
|
|
|
- DoHandleDirective(Self,Directive,Param,Handled);
|
|
|
|
- if (not Handled) then
|
|
|
|
- if LogEvent(sleDirective) then
|
|
|
|
- DoLog(mtWarning,nWarnIllegalCompilerDirectiveX,sWarnIllegalCompilerDirectiveX,
|
|
|
|
- [Directive]);
|
|
|
|
end;
|
|
end;
|
|
|
|
+ DoHandleDirective(Self,Directive,Param,Handled);
|
|
|
|
+ if not (Handled or IsFlowControl) then // in case of flowcontrol, it is definitely handled
|
|
|
|
+ if LogEvent(sleDirective) then
|
|
|
|
+ DoLog(mtWarning,nWarnIllegalCompilerDirectiveX,sWarnIllegalCompilerDirectiveX,
|
|
|
|
+ [Directive]);
|
|
end;
|
|
end;
|
|
|
|
|
|
function TPascalScanner.HandleLetterDirective(Letter: char; Enable: boolean): TToken;
|
|
function TPascalScanner.HandleLetterDirective(Letter: char; Enable: boolean): TToken;
|