diff --git a/clang/docs/tools/dump_format_style.py b/clang/docs/tools/dump_format_style.py --- a/clang/docs/tools/dump_format_style.py +++ b/clang/docs/tools/dump_format_style.py @@ -159,10 +159,20 @@ self.comment = comment self.config = config + @property + def clean_name(self) -> str: + # In case the enum value has an explicit value (e.g. enum foo {bar = 42};) + # we remove everything after the equal sign and just use "bar". + return self.name.split("=", 1)[0].strip() + + @property + def clean_config(self) -> str: + return re.sub('.*_', '', self.config).split("=", 1)[0].strip() + def __str__(self): return '* ``%s`` (in configuration: ``%s``)\n%s' % ( - self.name, - re.sub('.*_', '', self.config), + self.clean_name, + self.clean_config, doxygen2rst(indent(self.comment, 2)))