Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(242)

Side by Side Diff: Source/build/scripts/make_css_value_keywords.py

Issue 469183002: Move parser-related files in core/css to core/css/parser (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@pp2
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/build/scripts/make_css_property_names.py ('k') | Source/core/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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)
OLDNEW
« no previous file with comments | « Source/build/scripts/make_css_property_names.py ('k') | Source/core/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698