From d9523c145cabcddc346b4fcae1a86e5d8773edfd Mon Sep 17 00:00:00 2001 From: Stephen Heumann Date: Thu, 20 Jul 2017 17:32:06 -0500 Subject: [PATCH] Allow unknown preprocessor directives in skipped blocks. For example, the following should not generate an error: #if 0 #warning "..." #endif --- Scanner.pas | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Scanner.pas b/Scanner.pas index 4d6de16..b922602 100644 --- a/Scanner.pas +++ b/Scanner.pas @@ -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}