diff options
author | Ms2ger <ms2ger@gmail.com> | 2014-03-11 13:24:10 +0100 |
---|---|---|
committer | Ms2ger <ms2ger@gmail.com> | 2014-03-11 13:24:10 +0100 |
commit | d71e43e71204e35c0bbefd51bb8a4abf2d1f328e (patch) | |
tree | 8d1353dd50d6af418ad8c40b461e89315a8b427e /src/components/script/dom/bindings/codegen/GlobalGen.py | |
parent | 6c3f67d71966bf3e97c058ee40eefc37e65440b8 (diff) | |
download | servo-d71e43e71204e35c0bbefd51bb8a4abf2d1f328e.tar.gz servo-d71e43e71204e35c0bbefd51bb8a4abf2d1f328e.zip |
Remove a pointless argument to generate_file in GlobalGen.py.
Diffstat (limited to 'src/components/script/dom/bindings/codegen/GlobalGen.py')
-rw-r--r-- | src/components/script/dom/bindings/codegen/GlobalGen.py | 32 |
1 files changed, 12 insertions, 20 deletions
diff --git a/src/components/script/dom/bindings/codegen/GlobalGen.py b/src/components/script/dom/bindings/codegen/GlobalGen.py index bd8b3d70793..4898cf1a725 100644 --- a/src/components/script/dom/bindings/codegen/GlobalGen.py +++ b/src/components/script/dom/bindings/codegen/GlobalGen.py @@ -17,21 +17,13 @@ from CodegenRust import GlobalGenRoots, replaceFileIfChanged # import Codegen in general, so we can set a variable on it import Codegen -def generate_file(config, name, action): +def generate_file(config, name): + filename = name + '.rs' root = getattr(GlobalGenRoots, name)(config) - if action is 'declare': - filename = name + '.rs' - code = root.declare() - elif action == 'declare+define': - filename = name + '.rs' - code = root.declare() - root2 = getattr(GlobalGenRoots, name)(config) - code += root2.define() - else: - assert action is 'define' - filename = name + '.rs' - code = root.define() + code = root.declare() + root2 = getattr(GlobalGenRoots, name)(config) + code += root2.define() if replaceFileIfChanged(filename, code): print "Generating %s" % (filename) @@ -75,22 +67,22 @@ def main(): config = Configuration(configFile, parserResults) # Generate the prototype list. - generate_file(config, 'PrototypeList', 'declare+define') + generate_file(config, 'PrototypeList') # Generate the common code. - generate_file(config, 'RegisterBindings', 'declare+define') + generate_file(config, 'RegisterBindings') # Generate the type list. - generate_file(config, 'InterfaceTypes', 'declare+define') + generate_file(config, 'InterfaceTypes') # Generate the type list. - generate_file(config, 'InheritTypes', 'declare+define') + generate_file(config, 'InheritTypes') # Generate the module declarations. - generate_file(config, 'BindingDeclarations', 'declare+define') + generate_file(config, 'BindingDeclarations') - generate_file(config, 'UnionTypes', 'declare+define') - generate_file(config, 'UnionConversions', 'declare+define') + generate_file(config, 'UnionTypes') + generate_file(config, 'UnionConversions') if __name__ == '__main__': main() |