| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 | 2 |
| 3 import subprocess | 3 import subprocess |
| 4 import sys | 4 import sys |
| 5 | 5 |
| 6 import css_properties | 6 import css_properties |
| 7 import in_generator | 7 import in_generator |
| 8 import license | 8 import license |
| 9 | 9 |
| 10 | 10 |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 %%struct-type | 108 %%struct-type |
| 109 struct Property; | 109 struct Property; |
| 110 %%omit-struct-type | 110 %%omit-struct-type |
| 111 %%language=C++ | 111 %%language=C++ |
| 112 %%readonly-tables | 112 %%readonly-tables |
| 113 %%global-table | 113 %%global-table |
| 114 %%compare-strncmp | 114 %%compare-strncmp |
| 115 %%define class-name %(class_name)sHash | 115 %%define class-name %(class_name)sHash |
| 116 %%define lookup-function-name findPropertyImpl | 116 %%define lookup-function-name findPropertyImpl |
| 117 %%define hash-function-name property_hash_function | 117 %%define hash-function-name property_hash_function |
| 118 %%define slot-name nameOffset | 118 %%define slot-name name_offset |
| 119 %%define word-array-name property_word_list | 119 %%define word-array-name property_word_list |
| 120 %%enum | 120 %%enum |
| 121 %%%% | 121 %%%% |
| 122 %(property_to_enum_map)s | 122 %(property_to_enum_map)s |
| 123 %%%% | 123 %%%% |
| 124 const Property* findProperty(register const char* str, register unsigned int len
) | 124 const Property* findProperty(register const char* str, register unsigned int len
) |
| 125 { | 125 { |
| 126 return %(class_name)sHash::findPropertyImpl(str, len); | 126 return %(class_name)sHash::findPropertyImpl(str, len); |
| 127 } | 127 } |
| 128 | 128 |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 # FIXME: If we could depend on Python 2.7, we would use subprocess.check
_output | 229 # FIXME: If we could depend on Python 2.7, we would use subprocess.check
_output |
| 230 gperf_args = [self.gperf_path, '--key-positions=*', '-P', '-n'] | 230 gperf_args = [self.gperf_path, '--key-positions=*', '-P', '-n'] |
| 231 gperf_args.extend(['-m', '50']) # Pick best of 50 attempts. | 231 gperf_args.extend(['-m', '50']) # Pick best of 50 attempts. |
| 232 gperf_args.append('-D') # Allow duplicate hashes -> More compact code. | 232 gperf_args.append('-D') # Allow duplicate hashes -> More compact code. |
| 233 gperf = subprocess.Popen(gperf_args, stdin=subprocess.PIPE, stdout=subpr
ocess.PIPE, universal_newlines=True) | 233 gperf = subprocess.Popen(gperf_args, stdin=subprocess.PIPE, stdout=subpr
ocess.PIPE, universal_newlines=True) |
| 234 return gperf.communicate(gperf_input)[0] | 234 return gperf.communicate(gperf_input)[0] |
| 235 | 235 |
| 236 | 236 |
| 237 if __name__ == "__main__": | 237 if __name__ == "__main__": |
| 238 in_generator.Maker(CSSPropertyNamesWriter).main(sys.argv) | 238 in_generator.Maker(CSSPropertyNamesWriter).main(sys.argv) |
| OLD | NEW |