summaryrefslogtreecommitdiff
path: root/scripts/spidermonkify.py
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2016-03-05 16:48:03 -0800
committerAlon Zakai <alonzakai@gmail.com>2016-03-05 16:48:03 -0800
commitd1b8d2fc754aca8e4313e28d6440d0ebe958e804 (patch)
tree98f4b19881336b1c105d7fff7d2dcfaa505e0863 /scripts/spidermonkify.py
parent69b457cd2da748175f8fc46312c8f7b40e368205 (diff)
downloadbinaryen-d1b8d2fc754aca8e4313e28d6440d0ebe958e804.tar.gz
binaryen-d1b8d2fc754aca8e4313e28d6440d0ebe958e804.tar.bz2
binaryen-d1b8d2fc754aca8e4313e28d6440d0ebe958e804.zip
more python fixes
Diffstat (limited to 'scripts/spidermonkify.py')
-rw-r--r--scripts/spidermonkify.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/scripts/spidermonkify.py b/scripts/spidermonkify.py
index 2e2da10bd..992e7d48d 100644
--- a/scripts/spidermonkify.py
+++ b/scripts/spidermonkify.py
@@ -21,6 +21,7 @@ wasm_target = wast_target[:-5] + '.wasm'
base_wast_target = os.path.basename(wast_target)
base_wasm_target = os.path.basename(wasm_target)
+
def fix(js, before, after):
assert js.count(before) == 1
return js.replace(before, after)
@@ -57,8 +58,9 @@ parts = memory.split(' ')
parts[1] = str(int(math.ceil(float(parts[1]) / PAGE_SIZE)))
if len(parts) == 3:
parts[2] = str(int(math.ceil(float(parts[2]) / PAGE_SIZE)))
-wast = wast[:memory_start] + ' '.join(parts) + wast[memory_end:memory_end+1] + \
- ' (export "memory" memory) ' + wast[memory_end+1:]
+wast = wast[:memory_start] + ' '.join(parts) + \
+ wast[memory_end:memory_end + 1] + \
+ ' (export "memory" memory) ' + wast[memory_end + 1:]
open(wast_target, 'w').write(wast)
# convert to binary using spidermonkey