Skip to content

Commit 8cbb4da

Browse files
committed
snap
1 parent 125a27c commit 8cbb4da

13 files changed

+57
-42
lines changed

jscomp/test/flow_parser_reg_test.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -2144,7 +2144,7 @@ function float_of_string(str) {
21442144
var exponent = decimal_exponent !== undefined ? f.exponent + decimal_exponent | 0 : f.exponent;
21452145
var ret$1 = exponent === 0 ? ret : Math.pow(ret, exponent);
21462146
if (f.negative) {
2147-
return -ret$1;
2147+
return - ret$1;
21482148
} else {
21492149
return ret$1;
21502150
}
@@ -2320,7 +2320,7 @@ function mk_num_singleton(number_type, num, neg) {
23202320
} else {
23212321
value = Caml_format.int_of_string(num);
23222322
}
2323-
var value$1 = neg === "" ? value : -value;
2323+
var value$1 = neg === "" ? value : - value;
23242324
return {
23252325
TAG: /* T_NUMBER_SINGLETON_TYPE */5,
23262326
_0: number_type,

jscomp/test/mario_game.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -803,7 +803,7 @@ function set_vel_to_speed(obj) {
803803
if (match) {
804804
obj.vel.x = speed;
805805
} else {
806-
obj.vel.x = -speed;
806+
obj.vel.x = - speed;
807807
}
808808
}
809809

@@ -955,7 +955,7 @@ function update_player(player, keys, context) {
955955
switch (param) {
956956
case /* CLeft */0 :
957957
if (!player.crouch) {
958-
if (player.vel.x > -player.params.speed) {
958+
if (player.vel.x > - player.params.speed) {
959959
player.vel.x = player.vel.x - (0.4 - lr_acc);
960960
}
961961
player.dir = /* Left */0;
@@ -1108,7 +1108,7 @@ function collide_block(check_xOpt, dir, obj) {
11081108
}
11091109

11101110
function reverse_left_right(obj) {
1111-
obj.vel.x = -obj.vel.x;
1111+
obj.vel.x = - obj.vel.x;
11121112
obj.dir = obj.dir ? /* Left */0 : /* Right */1;
11131113
}
11141114

@@ -1440,7 +1440,7 @@ function render(sprite, param) {
14401440

14411441
function draw_bgd(bgd, off_x) {
14421442
render(bgd, [
1443-
-off_x,
1443+
- off_x,
14441444
0
14451445
]);
14461446
return render(bgd, [
@@ -1909,15 +1909,15 @@ function process_collision(dir, c1, c2, state) {
19091909
o1.grounded = true;
19101910
if (typ >= 3) {
19111911
var r2 = evolve_enemy(o1.dir, typ, s2, o2, context);
1912-
o1.vel.y = -4;
1912+
o1.vel.y = - 4;
19131913
o1.pos.y = o1.pos.y - 5;
19141914
return [
19151915
undefined,
19161916
r2
19171917
];
19181918
}
19191919
dec_health(o2);
1920-
o1.vel.y = -4;
1920+
o1.vel.y = - 4;
19211921
if (state.multiplier === 8) {
19221922
update_score(state, 800);
19231923
o2.score = 800;

lib/4.06.1/unstable/js_compiler.ml

+9-4
Original file line numberDiff line numberDiff line change
@@ -79749,7 +79749,10 @@ and expression_desc cxt ~(level : int) f x : cxt =
7974979749
expression ~level:13 cxt f e
7975079750
| Bin
7975179751
( Minus,
79752-
{ expression_desc = Number (Int { i = 0l; _ } | Float { f = "0." }) },
79752+
{
79753+
expression_desc =
79754+
Number ((Int { i = 0l; _ } | Float { f = "0." }) as desc);
79755+
},
7975379756
e )
7975479757
(* TODO:
7975579758
Handle multiple cases like
@@ -79758,7 +79761,7 @@ and expression_desc cxt ~(level : int) f x : cxt =
7975879761
{[ 0.000 - x ]}
7975979762
*) ->
7976079763
P.cond_paren_group f (level > 13) 1 (fun _ ->
79761-
P.string f "-";
79764+
P.string f (match desc with Float _ -> "- " | _ -> "-");
7976279765
expression ~level:13 cxt f e)
7976379766
| Bin (op, e1, e2) ->
7976479767
let out, lft, rght = Js_op_util.op_prec op in
@@ -79801,8 +79804,10 @@ and expression_desc cxt ~(level : int) f x : cxt =
7980179804
Js_op.Lit (Ext_ident.convert x))))
7980279805
(*name convention of Record is slight different from modules*)
7980379806
| Caml_block (el, mutable_flag, _, Blk_record { fields; record_repr }) -> (
79804-
if Array.length fields <> 0 && Ext_array.for_alli fields (fun i v -> string_of_int i = v) then
79805-
expression_desc cxt ~level f (Array (el, mutable_flag))
79807+
if
79808+
Array.length fields <> 0
79809+
&& Ext_array.for_alli fields (fun i v -> string_of_int i = v)
79810+
then expression_desc cxt ~level f (Array (el, mutable_flag))
7980679811
else
7980779812
match record_repr with
7980879813
| Record_regular ->

lib/4.06.1/unstable/js_playground_compiler.ml

+9-4
Original file line numberDiff line numberDiff line change
@@ -79749,7 +79749,10 @@ and expression_desc cxt ~(level : int) f x : cxt =
7974979749
expression ~level:13 cxt f e
7975079750
| Bin
7975179751
( Minus,
79752-
{ expression_desc = Number (Int { i = 0l; _ } | Float { f = "0." }) },
79752+
{
79753+
expression_desc =
79754+
Number ((Int { i = 0l; _ } | Float { f = "0." }) as desc);
79755+
},
7975379756
e )
7975479757
(* TODO:
7975579758
Handle multiple cases like
@@ -79758,7 +79761,7 @@ and expression_desc cxt ~(level : int) f x : cxt =
7975879761
{[ 0.000 - x ]}
7975979762
*) ->
7976079763
P.cond_paren_group f (level > 13) 1 (fun _ ->
79761-
P.string f "-";
79764+
P.string f (match desc with Float _ -> "- " | _ -> "-");
7976279765
expression ~level:13 cxt f e)
7976379766
| Bin (op, e1, e2) ->
7976479767
let out, lft, rght = Js_op_util.op_prec op in
@@ -79801,8 +79804,10 @@ and expression_desc cxt ~(level : int) f x : cxt =
7980179804
Js_op.Lit (Ext_ident.convert x))))
7980279805
(*name convention of Record is slight different from modules*)
7980379806
| Caml_block (el, mutable_flag, _, Blk_record { fields; record_repr }) -> (
79804-
if Array.length fields <> 0 && Ext_array.for_alli fields (fun i v -> string_of_int i = v) then
79805-
expression_desc cxt ~level f (Array (el, mutable_flag))
79807+
if
79808+
Array.length fields <> 0
79809+
&& Ext_array.for_alli fields (fun i v -> string_of_int i = v)
79810+
then expression_desc cxt ~level f (Array (el, mutable_flag))
7980679811
else
7980779812
match record_repr with
7980879813
| Record_regular ->

lib/4.06.1/whole_compiler.ml

+9-4
Original file line numberDiff line numberDiff line change
@@ -255718,7 +255718,10 @@ and expression_desc cxt ~(level : int) f x : cxt =
255718255718
expression ~level:13 cxt f e
255719255719
| Bin
255720255720
( Minus,
255721-
{ expression_desc = Number (Int { i = 0l; _ } | Float { f = "0." }) },
255721+
{
255722+
expression_desc =
255723+
Number ((Int { i = 0l; _ } | Float { f = "0." }) as desc);
255724+
},
255722255725
e )
255723255726
(* TODO:
255724255727
Handle multiple cases like
@@ -255727,7 +255730,7 @@ and expression_desc cxt ~(level : int) f x : cxt =
255727255730
{[ 0.000 - x ]}
255728255731
*) ->
255729255732
P.cond_paren_group f (level > 13) 1 (fun _ ->
255730-
P.string f "-";
255733+
P.string f (match desc with Float _ -> "- " | _ -> "-");
255731255734
expression ~level:13 cxt f e)
255732255735
| Bin (op, e1, e2) ->
255733255736
let out, lft, rght = Js_op_util.op_prec op in
@@ -255770,8 +255773,10 @@ and expression_desc cxt ~(level : int) f x : cxt =
255770255773
Js_op.Lit (Ext_ident.convert x))))
255771255774
(*name convention of Record is slight different from modules*)
255772255775
| Caml_block (el, mutable_flag, _, Blk_record { fields; record_repr }) -> (
255773-
if Array.length fields <> 0 && Ext_array.for_alli fields (fun i v -> string_of_int i = v) then
255774-
expression_desc cxt ~level f (Array (el, mutable_flag))
255776+
if
255777+
Array.length fields <> 0
255778+
&& Ext_array.for_alli fields (fun i v -> string_of_int i = v)
255779+
then expression_desc cxt ~level f (Array (el, mutable_flag))
255775255780
else
255776255781
match record_repr with
255777255782
| Record_regular ->

lib/es6/caml_float.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ function modf_float(x) {
2929
var f = x$1 - i;
3030
if (neg) {
3131
return [
32-
-f,
33-
-i
32+
- f,
33+
- i
3434
];
3535
} else {
3636
return [
@@ -68,13 +68,13 @@ function frexp_float(x) {
6868
var neg = x < 0;
6969
var x$p = Math.abs(x);
7070
var exp = Math.floor(Math.LOG2E * Math.log(x$p)) + 1;
71-
x$p = x$p * Math.pow(2, -exp);
71+
x$p = x$p * Math.pow(2, - exp);
7272
if (x$p < 0.5) {
7373
x$p = x$p * 2;
7474
exp = exp - 1;
7575
}
7676
if (neg) {
77-
x$p = -x$p;
77+
x$p = - x$p;
7878
}
7979
return [
8080
x$p,
@@ -86,7 +86,7 @@ function copysign_float(x, y) {
8686
var x$1 = Math.abs(x);
8787
var y$1 = y === 0 ? 1 / y : y;
8888
if (y$1 < 0) {
89-
return -x$1;
89+
return - x$1;
9090
} else {
9191
return x$1;
9292
}

lib/es6/caml_format.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -654,7 +654,7 @@ function int64_format(fmt, x) {
654654
function format_float(fmt, x) {
655655
var f = parse_format(fmt);
656656
var prec = f.prec < 0 ? 6 : f.prec;
657-
var x$1 = x < 0 ? (f.sign = -1, -x) : x;
657+
var x$1 = x < 0 ? (f.sign = -1, - x) : x;
658658
var s = "";
659659
if (isNaN(x$1)) {
660660
s = "nan";

lib/es6/caml_int64.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ function of_float(x) {
320320
return max_int;
321321
}
322322
if (x < 0) {
323-
return neg(of_float(-x));
323+
return neg(of_float(- x));
324324
}
325325
var hi = x / 4294967296 | 0;
326326
var lo = x % 4294967296 | 0;

lib/es6/complex.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@ function sub(x, y) {
2222

2323
function neg(x) {
2424
return {
25-
re: -x.re,
26-
im: -x.im
25+
re: - x.re,
26+
im: - x.im
2727
};
2828
}
2929

3030
function conj(x) {
3131
return {
3232
re: x.re,
33-
im: -x.im
33+
im: - x.im
3434
};
3535
}
3636

@@ -119,7 +119,7 @@ function sqrt(x) {
119119
} else {
120120
return {
121121
re: 0.5 * i / w,
122-
im: x.im >= 0.0 ? w : -w
122+
im: x.im >= 0.0 ? w : - w
123123
};
124124
}
125125
}

lib/js/caml_float.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ function modf_float(x) {
2929
var f = x$1 - i;
3030
if (neg) {
3131
return [
32-
-f,
33-
-i
32+
- f,
33+
- i
3434
];
3535
} else {
3636
return [
@@ -68,13 +68,13 @@ function frexp_float(x) {
6868
var neg = x < 0;
6969
var x$p = Math.abs(x);
7070
var exp = Math.floor(Math.LOG2E * Math.log(x$p)) + 1;
71-
x$p = x$p * Math.pow(2, -exp);
71+
x$p = x$p * Math.pow(2, - exp);
7272
if (x$p < 0.5) {
7373
x$p = x$p * 2;
7474
exp = exp - 1;
7575
}
7676
if (neg) {
77-
x$p = -x$p;
77+
x$p = - x$p;
7878
}
7979
return [
8080
x$p,
@@ -86,7 +86,7 @@ function copysign_float(x, y) {
8686
var x$1 = Math.abs(x);
8787
var y$1 = y === 0 ? 1 / y : y;
8888
if (y$1 < 0) {
89-
return -x$1;
89+
return - x$1;
9090
} else {
9191
return x$1;
9292
}

lib/js/caml_format.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -654,7 +654,7 @@ function int64_format(fmt, x) {
654654
function format_float(fmt, x) {
655655
var f = parse_format(fmt);
656656
var prec = f.prec < 0 ? 6 : f.prec;
657-
var x$1 = x < 0 ? (f.sign = -1, -x) : x;
657+
var x$1 = x < 0 ? (f.sign = -1, - x) : x;
658658
var s = "";
659659
if (isNaN(x$1)) {
660660
s = "nan";

lib/js/caml_int64.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ function of_float(x) {
320320
return max_int;
321321
}
322322
if (x < 0) {
323-
return neg(of_float(-x));
323+
return neg(of_float(- x));
324324
}
325325
var hi = x / 4294967296 | 0;
326326
var lo = x % 4294967296 | 0;

lib/js/complex.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@ function sub(x, y) {
2222

2323
function neg(x) {
2424
return {
25-
re: -x.re,
26-
im: -x.im
25+
re: - x.re,
26+
im: - x.im
2727
};
2828
}
2929

3030
function conj(x) {
3131
return {
3232
re: x.re,
33-
im: -x.im
33+
im: - x.im
3434
};
3535
}
3636

@@ -119,7 +119,7 @@ function sqrt(x) {
119119
} else {
120120
return {
121121
re: 0.5 * i / w,
122-
im: x.im >= 0.0 ? w : -w
122+
im: x.im >= 0.0 ? w : - w
123123
};
124124
}
125125
}

0 commit comments

Comments
 (0)