diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-12-15 20:13:50 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-12-15 20:13:50 -0800 |
commit | 033140dd7b37bcf7ca70a5ec0fda00436e0d06a6 (patch) | |
tree | da584cdab5092be47af940364a607ac22280dc4b /emscripten.py | |
parent | 592a1e9b957828b63ff5679f294101d6ad9f4a89 (diff) |
more float dotzero fixes
Diffstat (limited to 'emscripten.py')
-rwxr-xr-x | emscripten.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/emscripten.py b/emscripten.py index 67011790..111c2df4 100755 --- a/emscripten.py +++ b/emscripten.py @@ -816,7 +816,7 @@ def emscript_fast(infile, settings, outfile, libraries=[], compiler_engine=None, # fix +float into float.0, if not running js opts if not settings['RUNNING_JS_OPTS']: def fix_dot_zero(m): - num = m.group(2) + num = m.group(3) # TODO: handle 0x floats? if num.find('.') < 0: e = num.find('e'); @@ -824,8 +824,8 @@ def emscript_fast(infile, settings, outfile, libraries=[], compiler_engine=None, num += '.0' else: num = num[:e] + '.0' + num[e:] - return m.group(1) + num - funcs = re.sub(r'([(=,] *)\+((0x)?[0-9a-f]*\.?[0-9]+([eE][-+]?[0-9]+)?)', lambda m: fix_dot_zero(m), funcs) + return m.group(1) + m.group(2) + num + funcs = re.sub(r'([(=,+\-*/%] *)\+(-?)((0x)?[0-9a-f]*\.?[0-9]+([eE][-+]?[0-9]+)?)', lambda m: fix_dot_zero(m), funcs) # js compiler |