From 3fae6910dbd6b7b112c70597dfcc4b5261d7c746 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludvig=20Gunne=20Lindstr=C3=B6m?= Date: Sun, 31 May 2026 12:26:51 +0200 Subject: [PATCH 1/2] add test --- test.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/test.cpp b/test.cpp index cd6a4db5..51eee781 100644 --- a/test.cpp +++ b/test.cpp @@ -493,6 +493,7 @@ static void combineOperators_andequal() ASSERT_EQUALS("x &= 2 ;", preprocess("x &= 2;")); ASSERT_EQUALS("void f ( x & = 2 ) ;", preprocess("void f(x &= 2);")); ASSERT_EQUALS("f ( x &= 2 ) ;", preprocess("f(x &= 2);")); + ASSERT_EQUALS("f ( ) { return new int ( i &= 1 ) ; }", preprocess("f () { return new int(i &= 1); }")); } static void combineOperators_ellipsis() From 1769a10df17803054cbd54d9f5c8b2a7bdb862e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludvig=20Gunne=20Lindstr=C3=B6m?= Date: Sun, 31 May 2026 12:26:44 +0200 Subject: [PATCH 2/2] fix #657 --- simplecpp.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/simplecpp.cpp b/simplecpp.cpp index a7ced05a..116b71ce 100644 --- a/simplecpp.cpp +++ b/simplecpp.cpp @@ -1025,7 +1025,7 @@ void simplecpp::TokenList::combineOperators() continue; } const Token *prev = tok->previous; - while (prev && prev->isOneOf(";{}()")) + while (prev && prev->isOneOf(";{}(")) prev = prev->previous; executableScope.push(prev && prev->op == ')'); continue;