Page MenuHomePhabricator

[clang][cli] Let denormalizer decide how to render the option based on the option class
ClosedPublic

Authored by jansvoboda11 on Jul 20 2020, 10:05 AM.

Details

Summary

Before this patch, you needed to use AutoNormalizeEnumJoined whenever you wanted to denormalize joined enum.
Besides the naming confusion, this means the fact the option is joined is specified in two places: in the normalization multiclass and in the Joined<["-"], ...> multiclass.
This patch makes this work automatically, taking into account the OptionClass of options.

Also, the enum denormalizer now just looks up the spelling of the present enum case in a table and forwards it to the string denormalizer.

I also added more tests that exercise this.

Diff Detail

Event Timeline

dang created this revision.Jul 20 2020, 10:05 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptJul 20 2020, 10:05 AM
jansvoboda11 commandeered this revision.Dec 18 2020, 2:21 AM
jansvoboda11 added a reviewer: dang.
jansvoboda11 added a subscriber: jansvoboda11.

Taking over this patch, as Daniel is no longer involved.

jansvoboda11 retitled this revision from Let denormalizer decide how to render the option based on the option class to [clang][cli] Let denormalizer decide how to render the option based on the option class.Dec 18 2020, 4:55 AM
jansvoboda11 edited the summary of this revision. (Show Details)

Rebase, add tests

jansvoboda11 edited the summary of this revision. (Show Details)Dec 18 2020, 5:09 AM
jansvoboda11 added a reviewer: dexonsmith.
jansvoboda11 edited the summary of this revision. (Show Details)
This revision is now accepted and ready to land.Dec 18 2020, 1:04 PM
This revision was landed with ongoing or failed builds.Dec 21 2020, 2:33 AM
This revision was automatically updated to reflect the committed changes.