Allow unknown preprocessor directives in skipped blocks.

For example, the following should not generate an error:

#if 0
#warning "..."
#endif
This commit is contained in:
Stephen Heumann 2017-07-20 17:32:06 -05:00
parent e242f03501
commit d9523c145c
1 changed files with 2 additions and 1 deletions

View File

@ -2790,7 +2790,8 @@ else if charKinds[ord(ch)] = ch_eol {allow null commands}
NextToken;
goto 2;
end; {else if}
Error(8); {bad preprocessor command}
if not tSkipping then
Error(8); {bad preprocessor command}
2:
charKinds[ord('#')] := ch_pound; {allow # as a token}
expandMacros := false; {skip to the end of the line}