mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-14 19:59:14 +02:00
codetools: elseif: mark active if enabled
git-svn-id: trunk@42481 -
This commit is contained in:
parent
60925a9ed7
commit
fb86536307
@ -4140,13 +4140,13 @@ procedure TLinkScanner.SkipTillEndifElse(SkippingUntil: TLSSkippingDirective);
|
|||||||
var
|
var
|
||||||
p: PChar;
|
p: PChar;
|
||||||
begin
|
begin
|
||||||
|
if FDirectivesCount>0 then
|
||||||
|
FDirectives[FDirectivesCount-1].State:=lsdsInactive;
|
||||||
if FSkippingDirectives<>lssdNone then begin
|
if FSkippingDirectives<>lssdNone then begin
|
||||||
FSkippingDirectives:=SkippingUntil;
|
FSkippingDirectives:=SkippingUntil;
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
FSkippingDirectives:=SkippingUntil;
|
FSkippingDirectives:=SkippingUntil;
|
||||||
if FDirectivesCount>0 then
|
|
||||||
FDirectives[FDirectivesCount-1].State:=lsdsInactive;
|
|
||||||
|
|
||||||
SrcPos:=CommentEndPos;
|
SrcPos:=CommentEndPos;
|
||||||
{$IFDEF ShowUpdateCleanedSrc}
|
{$IFDEF ShowUpdateCleanedSrc}
|
||||||
@ -4259,6 +4259,8 @@ begin
|
|||||||
RaiseException(Values.ErrorMsg)
|
RaiseException(Values.ErrorMsg)
|
||||||
end else if ExprResult then begin
|
end else if ExprResult then begin
|
||||||
// expression evaluates to true => stop skipping and parse block
|
// expression evaluates to true => stop skipping and parse block
|
||||||
|
if FDirectivesCount>0 then
|
||||||
|
FDirectives[FDirectivesCount-1].State:=lsdsActive;
|
||||||
if FSkippingDirectives<>lssdNone then begin
|
if FSkippingDirectives<>lssdNone then begin
|
||||||
{$IFDEF ShowUpdateCleanedSrc}
|
{$IFDEF ShowUpdateCleanedSrc}
|
||||||
debugln(['TLinkScanner.InternalIfDirective skipped front, using ELIFC part']);
|
debugln(['TLinkScanner.InternalIfDirective skipped front, using ELIFC part']);
|
||||||
@ -4267,8 +4269,6 @@ begin
|
|||||||
end;
|
end;
|
||||||
end else begin
|
end else begin
|
||||||
// expression evaluates to false => skip this block
|
// expression evaluates to false => skip this block
|
||||||
if StoreDirectives then
|
|
||||||
FDirectives[FDirectivesCount-1].State:=lsdsInactive;
|
|
||||||
SkipTillEndifElse(lssdTillElse);
|
SkipTillEndifElse(lssdTillElse);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user