| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright (C) 2013 Google Inc. All rights reserved. | 2 # Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 # | 3 # |
| 4 # Redistribution and use in source and binary forms, with or without | 4 # Redistribution and use in source and binary forms, with or without |
| 5 # modification, are permitted provided that the following conditions are | 5 # modification, are permitted provided that the following conditions are |
| 6 # met: | 6 # met: |
| 7 # | 7 # |
| 8 # * Redistributions of source code must retain the above copyright | 8 # * Redistributions of source code must retain the above copyright |
| 9 # notice, this list of conditions and the following disclaimer. | 9 # notice, this list of conditions and the following disclaimer. |
| 10 # * Redistributions in binary form must reproduce the above | 10 # * Redistributions in binary form must reproduce the above |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 import in_generator | 32 import in_generator |
| 33 import trie_builder | 33 import trie_builder |
| 34 import template_expander | 34 import template_expander |
| 35 | 35 |
| 36 | 36 |
| 37 class ElementLookupTrieWriter(in_generator.Writer): | 37 class ElementLookupTrieWriter(in_generator.Writer): |
| 38 # FIXME: Inherit all these from somewhere. | 38 # FIXME: Inherit all these from somewhere. |
| 39 defaults = { | 39 defaults = { |
| 40 'JSInterfaceName': None, | 40 'JSInterfaceName': None, |
| 41 'constructorNeedsCreatedByParser': None, | 41 'constructorNeedsCreatedByParser': None, |
| 42 'constructorNeedsCreatedByFragmentParser': None, |
| 42 'interfaceName': None, | 43 'interfaceName': None, |
| 43 'noConstructor': None, | 44 'noConstructor': None, |
| 44 'runtimeEnabled': None, | 45 'runtimeEnabled': None, |
| 45 } | 46 } |
| 46 default_parameters = { | 47 default_parameters = { |
| 47 'attrsNullNamespace': None, | 48 'attrsNullNamespace': None, |
| 48 'export': '', | 49 'export': '', |
| 49 'fallbackInterfaceName': '', | 50 'fallbackInterfaceName': '', |
| 50 'fallbackJSInterfaceName': '', | 51 'fallbackJSInterfaceName': '', |
| 51 'namespace': '', | 52 'namespace': '', |
| (...skipping 21 matching lines...) Expand all Loading... |
| 73 @template_expander.use_jinja('ElementLookupTrie.cpp.tmpl') | 74 @template_expander.use_jinja('ElementLookupTrie.cpp.tmpl') |
| 74 def generate_implementation(self): | 75 def generate_implementation(self): |
| 75 return { | 76 return { |
| 76 'namespace': self._namespace, | 77 'namespace': self._namespace, |
| 77 'length_tries': trie_builder.trie_list_by_str_length(self._tags) | 78 'length_tries': trie_builder.trie_list_by_str_length(self._tags) |
| 78 } | 79 } |
| 79 | 80 |
| 80 | 81 |
| 81 if __name__ == '__main__': | 82 if __name__ == '__main__': |
| 82 in_generator.Maker(ElementLookupTrieWriter).main(sys.argv) | 83 in_generator.Maker(ElementLookupTrieWriter).main(sys.argv) |
| OLD | NEW |