File: process_optimize_instructions.py

package info (click to toggle)
binaryen 68-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 34,900 kB
  • sloc: cpp: 57,351; ansic: 3,562; python: 2,898; sh: 700; makefile: 6
file content (16 lines) | stat: -rwxr-xr-x 392 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/usr/bin/python

import os

root = os.path.dirname(os.path.dirname(__file__))

infile = os.path.join(root, 'src', 'passes', 'OptimizeInstructions.wast')
outfile = os.path.join(root, 'src', 'passes',
                       'OptimizeInstructions.wast.processed')

out = open(outfile, 'w')

for line in open(infile):
  out.write('"' + line.strip().replace('"', '\\"') + '\\n"\n')

out.close()