From 8e1f63fca4db8bb99c3057ef487a77c0dfba9c35 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Thu, 28 Nov 2024 21:23:51 -0500 Subject: [PATCH] Fix nested #if 0 not working. Bug: issue #989 Test: new test csae --- compiler/lexer.cpp | 2 +- tests/compile-only/ok-nested-preproc-if.sp | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 tests/compile-only/ok-nested-preproc-if.sp diff --git a/compiler/lexer.cpp b/compiler/lexer.cpp index 45bcddd7..09458e55 100644 --- a/compiler/lexer.cpp +++ b/compiler/lexer.cpp @@ -651,7 +651,7 @@ void Lexer::HandleSkippedSection() { if (!IsSkipping()) return; - break; + continue; default: continue; diff --git a/tests/compile-only/ok-nested-preproc-if.sp b/tests/compile-only/ok-nested-preproc-if.sp new file mode 100644 index 00000000..070b5639 --- /dev/null +++ b/tests/compile-only/ok-nested-preproc-if.sp @@ -0,0 +1,8 @@ +public void main() +{ +#if 0 +#if 0 + return; +#endif +#endif +}