| 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 |
| 11 | 11 |
| 12 | 12 |
| 13 HEADER_TEMPLATE = """ | 13 HEADER_TEMPLATE = """ |
| 14 %(license)s | 14 %(license)s |
| 15 | 15 |
| 16 #ifndef %(class_name)s_h | 16 #ifndef %(class_name)s_h |
| 17 #define %(class_name)s_h | 17 #define %(class_name)s_h |
| 18 | 18 |
| 19 #include "core/css/CSSParserMode.h" | 19 #include "core/css/parser/CSSParserMode.h" |
| 20 #include <string.h> | 20 #include <string.h> |
| 21 | 21 |
| 22 namespace blink { | 22 namespace blink { |
| 23 | 23 |
| 24 enum CSSValueID { | 24 enum CSSValueID { |
| 25 %(value_keyword_enums)s | 25 %(value_keyword_enums)s |
| 26 }; | 26 }; |
| 27 | 27 |
| 28 const int numCSSValueKeywords = %(value_keywords_count)d; | 28 const int numCSSValueKeywords = %(value_keywords_count)d; |
| 29 const size_t maxCSSValueKeywordLength = %(max_value_keyword_length)d; | 29 const size_t maxCSSValueKeywordLength = %(max_value_keyword_length)d; |
| (...skipping 135 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 | 165 # 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'] | 166 gperf_args = [self.gperf_path, '--key-positions=*', '-P', '-n'] |
| 167 gperf_args.extend(['-m', '50']) # Pick best of 50 attempts. | 167 gperf_args.extend(['-m', '50']) # Pick best of 50 attempts. |
| 168 gperf_args.append('-D') # Allow duplicate hashes -> More compact code. | 168 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) | 169 gperf = subprocess.Popen(gperf_args, stdin=subprocess.PIPE, stdout=subpr
ocess.PIPE, universal_newlines=True) |
| 170 return gperf.communicate(gperf_input)[0] | 170 return gperf.communicate(gperf_input)[0] |
| 171 | 171 |
| 172 | 172 |
| 173 if __name__ == "__main__": | 173 if __name__ == "__main__": |
| 174 in_generator.Maker(CSSValueKeywordsWriter).main(sys.argv) | 174 in_generator.Maker(CSSValueKeywordsWriter).main(sys.argv) |
| OLD | NEW |