mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-12 10:09:08 +02:00
* $IFDEF also handles macros
git-svn-id: trunk@19997 -
This commit is contained in:
parent
1c85102924
commit
eb2b836b06
@ -1158,7 +1158,6 @@ Var
|
||||
ML : TMacroReader;
|
||||
|
||||
begin
|
||||
// Writeln('Handling macro ',FMacros[AIndex]);
|
||||
PushStackItem;
|
||||
M:=FMacros.Objects[AIndex] as TMacroDef;
|
||||
ML:=TMacroReader.Create(FCurFileName,M.Value);
|
||||
@ -1617,6 +1616,8 @@ begin
|
||||
begin
|
||||
Param := UpperCase(Param);
|
||||
Index := Defines.IndexOf(Param);
|
||||
if Index < 0 then
|
||||
Index := Macros.IndexOf(Param);
|
||||
if Index < 0 then
|
||||
begin
|
||||
PPSkipMode := ppSkipIfBranch;
|
||||
|
@ -184,6 +184,7 @@ type
|
||||
Procedure TestInclude2;
|
||||
Procedure TestMacro1;
|
||||
procedure TestMacro2;
|
||||
procedure TestMacro3;
|
||||
end;
|
||||
|
||||
implementation
|
||||
@ -1281,6 +1282,13 @@ begin
|
||||
TestTokens([tkbegin,tkend,tkDot],'{$DEFINE MM:=begin end}'#13#10'MM .',True,False);
|
||||
end;
|
||||
|
||||
procedure TTestScanner.TestMacro3;
|
||||
begin
|
||||
FScanner.SkipComments:=True;
|
||||
FScanner.SkipWhiteSpace:=True;
|
||||
TestTokens([tkof],'{$DEFINE MM:=begin end}'#13#10'{$IFDEF MM} of {$ELSE} in {$ENDIF}');
|
||||
end;
|
||||
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user