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

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

Issue 825063004: CSS Parser: Support CDO and CDC tokens (<!--, -->) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@lang
Patch Set: Created 5 years, 11 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 | « no previous file | Source/core/css/parser/CSSParserImpl.cpp » ('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 # Copyright 2014 The Chromium Authors. All rights reserved. 3 # Copyright 2014 The Chromium Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be 4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file. 5 # found in the LICENSE file.
6 6
7 import in_generator 7 import in_generator
8 import sys 8 import sys
9 import os 9 import os
10 10
(...skipping 18 matching lines...) Expand all
29 codepoints = {'(': 'leftParenthesis', 29 codepoints = {'(': 'leftParenthesis',
30 ')': 'rightParenthesis', 30 ')': 'rightParenthesis',
31 '[': 'leftBracket', 31 '[': 'leftBracket',
32 ']': 'rightBracket', 32 ']': 'rightBracket',
33 '{': 'leftBrace', 33 '{': 'leftBrace',
34 '}': 'rightBrace', 34 '}': 'rightBrace',
35 '+': 'plusOrFullStop', 35 '+': 'plusOrFullStop',
36 '.': 'plusOrFullStop', 36 '.': 'plusOrFullStop',
37 '-': 'hyphenMinus', 37 '-': 'hyphenMinus',
38 '*': 'asterisk', 38 '*': 'asterisk',
39 '<': 'lessThan',
39 ',': 'comma', 40 ',': 'comma',
40 '/': 'solidus', 41 '/': 'solidus',
41 '\\': 'reverseSolidus', 42 '\\': 'reverseSolidus',
42 ':': 'colon', 43 ':': 'colon',
43 ';': 'semiColon', 44 ';': 'semiColon',
44 '#': 'hash', 45 '#': 'hash',
45 '^': 'circumflexAccent', 46 '^': 'circumflexAccent',
46 '$': 'dollarSign', 47 '$': 'dollarSign',
47 '|': 'verticalLine', 48 '|': 'verticalLine',
48 '~': 'tilde', 49 '~': 'tilde',
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 94
94 def generate(self): 95 def generate(self):
95 array_size = 128 # SCHAR_MAX + 1 96 array_size = 128 # SCHAR_MAX + 1
96 token_lines = [' &CSSTokenizer::%s,' % token_type(i) 97 token_lines = [' &CSSTokenizer::%s,' % token_type(i)
97 if token_type(i) else ' 0,' 98 if token_type(i) else ' 0,'
98 for i in range(array_size)] 99 for i in range(array_size)]
99 return CPP_TEMPLATE.format(array_size=array_size, token_lines='\n'.join( token_lines), module_pyname=module_pyname) 100 return CPP_TEMPLATE.format(array_size=array_size, token_lines='\n'.join( token_lines), module_pyname=module_pyname)
100 101
101 if __name__ == '__main__': 102 if __name__ == '__main__':
102 in_generator.Maker(MakeCSSTokenizerCodePointsWriter).main(sys.argv) 103 in_generator.Maker(MakeCSSTokenizerCodePointsWriter).main(sys.argv)
OLDNEW
« no previous file with comments | « no previous file | Source/core/css/parser/CSSParserImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698