| 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 json5_generator | 7 import json5_generator |
| 8 import license | 8 import license |
| 9 | 9 |
| 10 | 10 |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 // We share the StringImpl with the AtomicStrings. | 149 // We share the StringImpl with the AtomicStrings. |
| 150 return getPropertyNameAtomicString(id).getString(); | 150 return getPropertyNameAtomicString(id).getString(); |
| 151 } | 151 } |
| 152 | 152 |
| 153 String getJSPropertyName(CSSPropertyID id) | 153 String getJSPropertyName(CSSPropertyID id) |
| 154 { | 154 { |
| 155 char result[maxCSSPropertyNameLength + 1]; | 155 char result[maxCSSPropertyNameLength + 1]; |
| 156 const char* cssPropertyName = getPropertyName(id); | 156 const char* cssPropertyName = getPropertyName(id); |
| 157 const char* propertyNamePointer = cssPropertyName; | 157 const char* propertyNamePointer = cssPropertyName; |
| 158 if (!propertyNamePointer) | 158 if (!propertyNamePointer) |
| 159 return emptyString(); | 159 return emptyString; |
| 160 | 160 |
| 161 char* resultPointer = result; | 161 char* resultPointer = result; |
| 162 while (char character = *propertyNamePointer++) { | 162 while (char character = *propertyNamePointer++) { |
| 163 if (character == '-') { | 163 if (character == '-') { |
| 164 char nextCharacter = *propertyNamePointer++; | 164 char nextCharacter = *propertyNamePointer++; |
| 165 if (!nextCharacter) | 165 if (!nextCharacter) |
| 166 break; | 166 break; |
| 167 character = (propertyNamePointer - 2 != cssPropertyName) ? toASCIIUp
per(nextCharacter) : nextCharacter; | 167 character = (propertyNamePointer - 2 != cssPropertyName) ? toASCIIUp
per(nextCharacter) : nextCharacter; |
| 168 } | 168 } |
| 169 *resultPointer++ = character; | 169 *resultPointer++ = character; |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 237 # CalledProcessError like subprocess would do when shell=True is set. | 237 # CalledProcessError like subprocess would do when shell=True is set. |
| 238 try: | 238 try: |
| 239 gperf = subprocess.Popen(gperf_args, stdin=subprocess.PIPE, stdout=s
ubprocess.PIPE, universal_newlines=True) | 239 gperf = subprocess.Popen(gperf_args, stdin=subprocess.PIPE, stdout=s
ubprocess.PIPE, universal_newlines=True) |
| 240 return gperf.communicate(gperf_input)[0] | 240 return gperf.communicate(gperf_input)[0] |
| 241 except OSError: | 241 except OSError: |
| 242 raise subprocess.CalledProcessError(127, gperf_args, output='Command
not found.') | 242 raise subprocess.CalledProcessError(127, gperf_args, output='Command
not found.') |
| 243 | 243 |
| 244 | 244 |
| 245 if __name__ == "__main__": | 245 if __name__ == "__main__": |
| 246 json5_generator.Maker(CSSPropertyNamesWriter).main() | 246 json5_generator.Maker(CSSPropertyNamesWriter).main() |
| OLD | NEW |