Skip to content

Commit 033140d

Browse files
committed
more float dotzero fixes
1 parent 592a1e9 commit 033140d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

emscripten.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -816,16 +816,16 @@ def emscript_fast(infile, settings, outfile, libraries=[], compiler_engine=None,
816816
# fix +float into float.0, if not running js opts
817817
if not settings['RUNNING_JS_OPTS']:
818818
def fix_dot_zero(m):
819-
num = m.group(2)
819+
num = m.group(3)
820820
# TODO: handle 0x floats?
821821
if num.find('.') < 0:
822822
e = num.find('e');
823823
if e < 0:
824824
num += '.0'
825825
else:
826826
num = num[:e] + '.0' + num[e:]
827-
return m.group(1) + num
828-
funcs = re.sub(r'([(=,] *)\+((0x)?[0-9a-f]*\.?[0-9]+([eE][-+]?[0-9]+)?)', lambda m: fix_dot_zero(m), funcs)
827+
return m.group(1) + m.group(2) + num
828+
funcs = re.sub(r'([(=,+\-*/%] *)\+(-?)((0x)?[0-9a-f]*\.?[0-9]+([eE][-+]?[0-9]+)?)', lambda m: fix_dot_zero(m), funcs)
829829

830830
# js compiler
831831

0 commit comments

Comments
 (0)