[Lldb-commits] [PATCH] D66398: 2/2: Fix `TestDataFormatterStdList` regression
Jan Kratochvil via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Thu Aug 22 07:42:39 PDT 2019
jankratochvil added a comment.
In D66398#1640871 <https://reviews.llvm.org/D66398#1640871>, @labath wrote:
> because these kinds of regular are horrid.
Yes, they are. So let's link with PCRE <https://www.pcre.org/> (BSD licensed).
> What was the problem with the dispatching solution?
I do not find it so easy as libc++ formatter is using static function `LibcxxStdListSyntheticFrontEndCreator` while libstdc++ is using new object instance `ScriptedSyntheticChildren`. The dispatching should be in `LibcxxStdListSyntheticFrontEndCreator` so should it store `new ScriptedSyntheticChildren` as a static variable?
And then I do not like that solution anyway. Currently the dispatching is based on type name strings so why not just do that? KISS <https://en.wiktionary.org/wiki/KISS>
> we can dispatch based on some other property. The presence of some member variable for instance?
So let's drop the type name completely and make the matching duck typed <https://en.wikipedia.org/wiki/Duck_typing>. Why to divert from how it is currently done?
Anyway sure feel free to rewrite it but the regression is fixed now.
CHANGES SINCE LAST ACTION
More information about the lldb-commits