Changeset 225724 in webkit for trunk/Source/JavaScriptCore/Scripts/make-js-file-arrays.py
- Timestamp:
- Dec 9, 2017, 8:58:36 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/Scripts/make-js-file-arrays.py
r225698 r225724 22 22 # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 23 24 from __future__ import print_function 24 25 import io 25 26 import os … … 61 62 62 63 headerFile = open(headerPath, 'w') 63 print >> headerFile, 'namespace {0:s} {{'.format(namespace)64 print('namespace {0:s} {{'.format(namespace), file=headerFile) 64 65 65 66 sourceFile = open(sourcePath, 'w') 66 print >> sourceFile, '#include "{0:s}"'.format(os.path.basename(headerPath))67 print >> sourceFile, 'namespace {0:s} {{'.format(namespace)67 print('#include "{0:s}"'.format(os.path.basename(headerPath)), file=sourceFile) 68 print('namespace {0:s} {{'.format(namespace), file=sourceFile) 68 69 69 70 jsm = JavascriptMinify() … … 82 83 variableName = os.path.splitext(os.path.basename(inputFileName))[0] 83 84 84 print >> headerFile, 'extern const char {0:s}JavaScript[{1:d}];'.format(variableName, size)85 print >> sourceFile, 'const char {0:s}JavaScript[{1:d}] = {{'.format(variableName, size)85 print('extern const char {0:s}JavaScript[{1:d}];'.format(variableName, size), file=headerFile) 86 print('const char {0:s}JavaScript[{1:d}] = {{'.format(variableName, size), file=sourceFile) 86 87 87 88 codepoints = map(ord, characters) 88 89 for codepointChunk in chunk(codepoints, 16): 89 print >> sourceFile, ' {0:s},'.format(','.join(map(stringifyCodepoint, codepointChunk)))90 print(' {0:s},'.format(','.join(map(stringifyCodepoint, codepointChunk))), file=sourceFile) 90 91 91 print >> sourceFile, '};'92 print('};', file=sourceFile) 92 93 93 print >> headerFile, '}} // namespace {0:s}'.format(namespace)94 print >> sourceFile, '}} // namespace {0:s}'.format(namespace)94 print('}} // namespace {0:s}'.format(namespace), file=headerFile) 95 print('}} // namespace {0:s}'.format(namespace), file=sourceFile) 95 96 96 97 if __name__ == '__main__':
Note:
See TracChangeset
for help on using the changeset viewer.