| Index: mojo/public/tools/bindings/pylib/mojom/parse/translate.py
|
| diff --git a/mojo/public/tools/bindings/pylib/mojom/parse/translate.py b/mojo/public/tools/bindings/pylib/mojom/parse/translate.py
|
| index 2300cb6f0381da79efca73960eae00f5b59a3725..e43cfd52243a5a633dfaad546d2ff3d11f39b2c5 100644
|
| --- a/mojo/public/tools/bindings/pylib/mojom/parse/translate.py
|
| +++ b/mojo/public/tools/bindings/pylib/mojom/parse/translate.py
|
| @@ -83,6 +83,7 @@ def _MapStruct(tree):
|
| struct['attributes'] = _MapAttributes(tree[2])
|
| struct['fields'] = _MapTree(_MapField, tree[3], 'FIELD')
|
| struct['enums'] = _MapTree(_MapEnum, tree[3], 'ENUM')
|
| + struct['constants'] = _MapTree(_MapConstant, tree[3], 'CONST')
|
| return struct
|
|
|
| def _MapInterface(tree):
|
| @@ -91,6 +92,7 @@ def _MapInterface(tree):
|
| interface['peer'] = _GetAttribute(tree[2], 'Peer')
|
| interface['methods'] = _MapTree(_MapMethod, tree[3], 'METHOD')
|
| interface['enums'] = _MapTree(_MapEnum, tree[3], 'ENUM')
|
| + interface['constants'] = _MapTree(_MapConstant, tree[3], 'CONST')
|
| return interface
|
|
|
| def _MapEnum(tree):
|
| @@ -99,6 +101,13 @@ def _MapEnum(tree):
|
| enum['fields'] = _MapTree(_MapEnumField, tree[2], 'ENUM_FIELD')
|
| return enum
|
|
|
| +def _MapConstant(tree):
|
| + constant = {}
|
| + constant['name'] = tree[2]
|
| + constant['kind'] = _MapKind(tree[1])
|
| + constant['value'] = tree[3]
|
| + return constant
|
| +
|
| def _MapModule(tree, name):
|
| mojom = {}
|
| mojom['name'] = name
|
| @@ -107,6 +116,7 @@ def _MapModule(tree, name):
|
| mojom['structs'] = _MapTree(_MapStruct, tree[3], 'STRUCT')
|
| mojom['interfaces'] = _MapTree(_MapInterface, tree[3], 'INTERFACE')
|
| mojom['enums'] = _MapTree(_MapEnum, tree[3], 'ENUM')
|
| + mojom['constants'] = _MapTree(_MapConstant, tree[3], 'CONST')
|
| return mojom
|
|
|
| def _MapImport(tree):
|
|
|