Skip to content

Commit

Permalink
don't $I files when in skipped $IFDEF/$IF (RomanYankovsky#208)
Browse files Browse the repository at this point in the history
If $INCLUDE/$I is found while in the $IF(N)DEF/$IF part which is being skipped (undefined conditional etc), include is ignored.

This speeds up parsing (especially if include file has to be found in a long search path) and makes the parser more compatible with Delphi which ignores $INCLUDE statements inside skipped blocks.
  • Loading branch information
gabr42 authored and RomanYankovsky committed Jul 27, 2017
1 parent b7d0b19 commit e6381f0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Source/SimpleParser/SimpleParser.Lexer.pas
Original file line number Diff line number Diff line change
Expand Up @@ -1595,7 +1595,7 @@ procedure TmwBasePasLex.BraceOpenProc;
begin
// if Assigned(FOnIncludeDirect) then
// FOnIncludeDirect(Self);
if Assigned(FIncludeHandler) then
if Assigned(FIncludeHandler) and (FDefineStack = 0) then
IncludeFile
else
Next;
Expand Down

0 comments on commit e6381f0

Please sign in to comment.