diff options
author | Ms2ger <ms2ger@gmail.com> | 2014-03-11 12:45:43 +0100 |
---|---|---|
committer | Ms2ger <ms2ger@gmail.com> | 2014-03-11 12:45:43 +0100 |
commit | c97408969e2bd3a96e326498e43e96457d5ed7a1 (patch) | |
tree | a896bd0ff3a25dad778cf2ffb0cbf6f02819f142 /src/components/script/dom/bindings/codegen | |
parent | f7a847c5818a04a8ef1e1d385afa2fedd891ee4a (diff) | |
download | servo-c97408969e2bd3a96e326498e43e96457d5ed7a1.tar.gz servo-c97408969e2bd3a96e326498e43e96457d5ed7a1.zip |
Cleanup the code in PrototypeList().
Diffstat (limited to 'src/components/script/dom/bindings/codegen')
-rw-r--r-- | src/components/script/dom/bindings/codegen/CodegenRust.py | 48 |
1 files changed, 5 insertions, 43 deletions
diff --git a/src/components/script/dom/bindings/codegen/CodegenRust.py b/src/components/script/dom/bindings/codegen/CodegenRust.py index 9701023b12d..459609bceec 100644 --- a/src/components/script/dom/bindings/codegen/CodegenRust.py +++ b/src/components/script/dom/bindings/codegen/CodegenRust.py @@ -5976,53 +5976,15 @@ class GlobalGenRoots(): @staticmethod def PrototypeList(config): - # Prototype ID enum. protos = [d.name for d in config.getDescriptors(hasInterfacePrototypeObject=True)] - idEnum = CGNamespacedEnum('id', 'ID', protos, [0], deriving="Eq") - idEnum = CGList([idEnum]) - idEnum.append(CGGeneric(declare="pub static MAX_PROTO_CHAIN_LENGTH: uint = " + - str(config.maxProtoChainLength) + ";\n\n")) - - # Wrap all of that in our namespaces. - #idEnum = CGNamespace.build(['mozilla', 'dom', 'prototypes'], - # CGWrapper(idEnum, pre='\n')) - #idEnum = CGWrapper(idEnum, post='\n') - - curr = CGList([idEnum]) - - # Constructor ID enum. - constructors = [d.name for d in config.getDescriptors(hasInterfaceObject=True, - hasInterfacePrototypeObject=False)] - idEnum = CGNamespacedEnum('id', 'ID', constructors, [0]) - - # Wrap all of that in our namespaces. - idEnum = CGNamespace.build(['mozilla', 'dom', 'constructors'], - CGWrapper(idEnum, pre='\n')) - idEnum = CGWrapper(idEnum, post='\n') - - #XXXjdm Not sure what to do with the constructors right now - #curr.append(idEnum) + return CGList([ + CGGeneric(AUTOGENERATED_WARNING_COMMENT), + CGGeneric("pub static MAX_PROTO_CHAIN_LENGTH: uint = %d;\n\n" % config.maxProtoChainLength), + CGNamespacedEnum('id', 'ID', protos, [0], deriving="Eq"), + ]) - #traitsDecl = CGGeneric(declare=""" -#template <prototypes::ID PrototypeID> -#struct PrototypeTraits; -# -#template <class ConcreteClass> -#struct PrototypeIDMap; -#""") - - #traitsDecl = CGNamespace.build(['mozilla', 'dom'], - # CGWrapper(traitsDecl, post='\n')) - - #curr.append(traitsDecl) - - # Add the auto-generated comment. - curr = CGWrapper(curr, pre=AUTOGENERATED_WARNING_COMMENT) - - # Done. - return curr @staticmethod def RegisterBindings(config): |