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:
committed by
Facebook Github Bot
parent
2ffc23f400
commit
0684795a89
2
enums.py
2
enums.py
@@ -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):
|
||||
|
Reference in New Issue
Block a user