Mark enum with [Flags] where they are used as flags

Summary:
Marks enum with ```[Flags]``` attribute, where they are used as flags.
Closes https://github.com/facebook/yoga/pull/515

Reviewed By: emilsjolander

Differential Revision: D4921807

Pulled By: splhack

fbshipit-source-id: f056189b76ee6e6c042417a7998bfd20a610c27f
This commit is contained in:
Lukas Wöhrl
2017-04-25 10:16:26 -07:00
committed by Facebook Github Bot
parent 2ffc23f400
commit 0684795a89
2 changed files with 3 additions and 0 deletions

View File

@@ -9,6 +9,7 @@
namespace Facebook.Yoga
{
[System.Flags]
public enum YogaPrintOptions
{
Layout = 1,

View File

@@ -223,6 +223,8 @@ for name, values in sorted(ENUMS.items()):
with open(root + '/csharp/Facebook.Yoga/Yoga%s.cs' % name, 'w') as f:
f.write(LICENSE)
f.write('namespace Facebook.Yoga\n{\n')
if isinstance(next(iter(values or []), None), tuple):
f.write(' [System.Flags]\n')
f.write(' public enum Yoga%s\n {\n' % name)
for value in values:
if isinstance(value, tuple):