| Index: mojo/public/bindings/parser/mojo_translate.py
|
| diff --git a/mojo/public/bindings/parser/mojo_translate.py b/mojo/public/bindings/parser/mojo_translate.py
|
| index 00b58a501132b90226fb32898117a7ac3176cacb..5f631ddcab1d2286e694f2d2b56c52f23a405ae2 100755
|
| --- a/mojo/public/bindings/parser/mojo_translate.py
|
| +++ b/mojo/public/bindings/parser/mojo_translate.py
|
| @@ -6,6 +6,7 @@
|
| """Translate parse tree to Mojom IR"""
|
|
|
|
|
| +import os
|
| import sys
|
|
|
|
|
| @@ -36,6 +37,14 @@ def MapOrdinal(ordinal):
|
| return int(ordinal[1:]) # Strip leading '@'
|
|
|
|
|
| +def MapAttributes(attributes):
|
| + out = {}
|
| + for attribute in attributes:
|
| + if attribute[0] == 'ATTRIBUTE':
|
| + out[attribute[1]] = attribute[2]
|
| + return out
|
| +
|
| +
|
| def MapFields(fields):
|
| out = []
|
| for field in fields:
|
| @@ -74,16 +83,17 @@ class MojomBuilder():
|
| def AddStruct(self, name, attributes, fields):
|
| struct = {}
|
| struct['name'] = name
|
| + # TODO(darin): Add support for |attributes|
|
| + #struct['attributes'] = MapAttributes(attributes)
|
| struct['fields'] = MapFields(fields)
|
| self.mojom['structs'].append(struct)
|
| - # TODO(darin): Add support for |attributes|
|
|
|
| def AddInterface(self, name, attributes, methods):
|
| interface = {}
|
| interface['name'] = name
|
| + interface['attributes'] = MapAttributes(attributes)
|
| interface['methods'] = MapMethods(methods)
|
| self.mojom['interfaces'].append(interface)
|
| - # TODO(darin): Add support for |attributes|
|
|
|
| def AddModule(self, name, namespace, contents):
|
| self.mojom['name'] = name
|
|
|