* $IFDEF also handles macros

git-svn-id: trunk@19997 -
This commit is contained in:
michael 2012-01-07 20:36:22 +00:00
parent 1c85102924
commit eb2b836b06
2 changed files with 10 additions and 1 deletions

View File

@ -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;

View File

@ -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;