Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support mask enums #191

Open
XVilka opened this issue Jun 13, 2019 · 1 comment
Open

Support mask enums #191

XVilka opened this issue Jun 13, 2019 · 1 comment

Comments

@XVilka
Copy link
Contributor

XVilka commented Jun 13, 2019

Basically when enum members define the bitmask, and the decoded output is the superposition of the enum members.

Something like

type feature_mask =
  | FEATURE1 [@value 1]
  | FEATURE2 [@value 8]
  | FEATURE3 [@value 0x400]
  [@@deriving maskenum, show]

And show attribute will generate the "FEATURE1 | FEATURE3" for 0x401 value for example.

@XVilka
Copy link
Contributor Author

XVilka commented Dec 16, 2019

I can add this feature if other people agree it is useful

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant