| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 | 2 |
| 3 import os.path | 3 import os.path |
| 4 import re | 4 import re |
| 5 import subprocess | 5 import subprocess |
| 6 import sys | 6 import sys |
| 7 | 7 |
| 8 from in_file import InFile | 8 from in_file import InFile |
| 9 import in_generator | 9 import in_generator |
| 10 import license | 10 import license |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 | 33 |
| 34 } // namespace blink | 34 } // namespace blink |
| 35 | 35 |
| 36 #endif // %(class_name)s_h | 36 #endif // %(class_name)s_h |
| 37 """ | 37 """ |
| 38 | 38 |
| 39 GPERF_TEMPLATE = """ | 39 GPERF_TEMPLATE = """ |
| 40 %%{ | 40 %%{ |
| 41 %(license)s | 41 %(license)s |
| 42 | 42 |
| 43 #include "config.h" | |
| 44 #include "%(class_name)s.h" | 43 #include "%(class_name)s.h" |
| 45 #include "core/css/HashTools.h" | 44 #include "core/css/HashTools.h" |
| 46 #include <string.h> | 45 #include <string.h> |
| 47 | 46 |
| 48 namespace blink { | 47 namespace blink { |
| 49 static const char valueListStringPool[] = { | 48 static const char valueListStringPool[] = { |
| 50 "\\0" | 49 "\\0" |
| 51 %(value_keyword_strings)s | 50 %(value_keyword_strings)s |
| 52 }; | 51 }; |
| 53 | 52 |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 # FIXME: If we could depend on Python 2.7, we would use subprocess.check
_output | 164 # FIXME: If we could depend on Python 2.7, we would use subprocess.check
_output |
| 166 gperf_args = [self.gperf_path, '--key-positions=*', '-P', '-n'] | 165 gperf_args = [self.gperf_path, '--key-positions=*', '-P', '-n'] |
| 167 gperf_args.extend(['-m', '50']) # Pick best of 50 attempts. | 166 gperf_args.extend(['-m', '50']) # Pick best of 50 attempts. |
| 168 gperf_args.append('-D') # Allow duplicate hashes -> More compact code. | 167 gperf_args.append('-D') # Allow duplicate hashes -> More compact code. |
| 169 gperf = subprocess.Popen(gperf_args, stdin=subprocess.PIPE, stdout=subpr
ocess.PIPE, universal_newlines=True) | 168 gperf = subprocess.Popen(gperf_args, stdin=subprocess.PIPE, stdout=subpr
ocess.PIPE, universal_newlines=True) |
| 170 return gperf.communicate(gperf_input)[0] | 169 return gperf.communicate(gperf_input)[0] |
| 171 | 170 |
| 172 | 171 |
| 173 if __name__ == "__main__": | 172 if __name__ == "__main__": |
| 174 in_generator.Maker(CSSValueKeywordsWriter).main(sys.argv) | 173 in_generator.Maker(CSSValueKeywordsWriter).main(sys.argv) |
| OLD | NEW |