Skip to content

Commit 58c9a43

Browse files
dmcppcheckclaude
andcommitted
Add HideSetExpander behind DUI::hideSetExpansion
Macro expansion with hide sets (Prosser's algorithm), selected with DUI::hideSetExpansion and a command line option in main.cpp. It handles function-like and object-like macros, #, ##, __VA_OPT__ and defined in a replacement list. The old expansion is still the default. test.cpp runs the test suite twice, once with each expander, so the new one is tested from the start. Cases the new expander does not handle yet are skipped with HIDESET_EXPANSION_TODO, and cases where the old expansion is wrong are marked TODO_OLD_EXPANSION_ASSERT_EQUALS. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
1 parent fdf4313 commit 58c9a43

4 files changed

Lines changed: 895 additions & 97 deletions

File tree

‎main.cpp‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,12 @@ int main(int argc, char **argv)
153153
found = true;
154154
}
155155
break;
156+
case 'h':
157+
if (std::strcmp(arg, "-hideset-expansion")==0) {
158+
dui.hideSetExpansion = true;
159+
found = true;
160+
}
161+
break;
156162
}
157163
if (!found) {
158164
std::cout << "error: option '" << arg << "' is unknown." << std::endl;
@@ -187,6 +193,7 @@ int main(int argc, char **argv)
187193
std::cout << " -e Output errors only." << std::endl;
188194
std::cout << " -f Fail when errors were encountered (exitcode 1)." << std::endl;
189195
std::cout << " -l Print lines numbers." << std::endl;
196+
std::cout << " -hideset-expansion Use the new macro expansion with hide sets (work in progress)." << std::endl;
190197
return 0;
191198
}
192199

0 commit comments

Comments
 (0)