Implement builder callback forwarding in the wire

This commit is contained in:
Corentin Wallez
2017-04-20 14:43:11 -04:00
committed by Corentin Wallez
parent 7f96177289
commit cd0ea35889
5 changed files with 225 additions and 19 deletions

View File

@@ -91,6 +91,7 @@ class ObjectType(Type):
Type.__init__(self, name, record)
self.methods = []
self.native_methods = []
self.built_type = None
############################################################
# PARSE
@@ -124,6 +125,14 @@ def link_object(obj, types):
obj.methods = [method for method in methods if not is_native_method(method)]
obj.native_methods = [method for method in methods if is_native_method(method)]
# Compute the built object type for builders
if obj.is_builder:
for method in obj.methods:
if method.name.canonical_case() == "get result":
obj.built_type = method.return_type
break
assert(obj.built_type != None)
def parse_json(json):
category_to_parser = {
'bitmask': BitmaskType,