diff options
Diffstat (limited to 'tools/json_schema_compiler/idl_schema.py')
-rw-r--r-- | tools/json_schema_compiler/idl_schema.py | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/tools/json_schema_compiler/idl_schema.py b/tools/json_schema_compiler/idl_schema.py index 44a4a55..e33f8f0 100644 --- a/tools/json_schema_compiler/idl_schema.py +++ b/tools/json_schema_compiler/idl_schema.py @@ -313,10 +313,16 @@ class Namespace(object): dictionary that the JSON schema compiler expects to see. ''' - def __init__(self, namespace_node, description, nodoc=False, internal=False): + def __init__(self, + namespace_node, + description, + nodoc=False, + internal=False, + platforms=None): self.namespace = namespace_node self.nodoc = nodoc self.internal = internal + self.platforms = platforms self.events = [] self.functions = [] self.types = [] @@ -344,7 +350,8 @@ class Namespace(object): 'types': self.types, 'functions': self.functions, 'internal': self.internal, - 'events': self.events} + 'events': self.events, + 'platforms': self.platforms} def process_interface(self, node): members = [] @@ -369,6 +376,7 @@ class IDLSchema(object): nodoc = False internal = False description = None + platforms = None for node in self.idl: if node.cls == 'Namespace': if not description: @@ -376,10 +384,11 @@ class IDLSchema(object): print('%s must have a namespace-level comment. This will ' 'appear on the API summary page.' % node.GetName()) description = '' - namespace = Namespace(node, description, nodoc, internal) + namespace = Namespace(node, description, nodoc, internal, platforms) namespaces.append(namespace.process()) nodoc = False internal = False + platforms = None elif node.cls == 'Copyright': continue elif node.cls == 'Comment': @@ -389,6 +398,8 @@ class IDLSchema(object): nodoc = bool(node.value) elif node.name == 'internal': internal = bool(node.value) + elif node.name == 'platforms': + platforms = list(node.value) else: continue else: |