git-svn-id: trunk@19997 -
@@ -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
Param := UpperCase(Param);
Index := Defines.IndexOf(Param);
+ if Index < 0 then
+ Index := Macros.IndexOf(Param);
if Index < 0 then
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);
+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;
+