Skip to content

Commit 3da918b

Browse files
committed
snapshot
1 parent e3a9b50 commit 3da918b

34 files changed

+6634
-6696
lines changed

jscomp/all.depend

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -511,9 +511,10 @@ core/lam_check.cmx : core/lam.cmx ext/ident_hash_set.cmx ext/ext_option.cmx \
511511
ext/ext_list.cmx core/lam_check.cmi
512512
core/lam_convert.cmx : core/primitive_compat.cmx core/lam_tag_info.cmx \
513513
core/lam_scc.cmx core/lam_primitive.cmx core/lam_module_ident.cmx \
514-
core/lam_constant.cmx core/lam.cmx ext/int_hashtbl.cmx ext/ident_set.cmx \
515-
ext/ident_hashtbl.cmx syntax/external_ffi_types.cmx ext/ext_string.cmx \
516-
ext/ext_list.cmx syntax/ast_exp_extension.cmx core/lam_convert.cmi
514+
core/lam_hit.cmx core/lam_constant.cmx core/lam.cmx ext/int_hashtbl.cmx \
515+
ext/ident_set.cmx ext/ident_hashtbl.cmx syntax/external_ffi_types.cmx \
516+
ext/ext_string.cmx ext/ext_list.cmx syntax/ast_exp_extension.cmx \
517+
core/lam_convert.cmi
517518
core/lam_print.cmx : core/lam_primitive.cmx core/lam_constant.cmx \
518519
core/lam_compat.cmx core/lam.cmx ext/ext_list.cmx core/lam_print.cmi
519520
core/lam_beta_reduce_util.cmx : core/lam.cmx ext/ident_hashtbl.cmx \

jscomp/test/.depend

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,8 @@ int_hashtbl_test.cmj : mt.cmj ../stdlib/list.cmj ../stdlib/hashtbl.cmj \
369369
int_map.cmj : ../stdlib/map.cmj
370370
int_overflow_test.cmj : ../stdlib/string.cmj mt.cmj ../runtime/js.cmj \
371371
../stdlib/int32.cmj ../stdlib/char.cmj
372+
int_switch_test.cmj : mt.cmj
373+
int_swtich_test.cmj :
372374
io_test.cmj : ../runtime/js.cmj
373375
js_array_test.cmj : mt.cmj ../runtime/js.cmj ../stdlib/array.cmj
374376
js_bool_test.cmj : mt.cmj

jscomp/test/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,7 @@ OTHERS := test_literals a test_ari test_export2 test_internalOO test_obj_simple_
260260
gpr_2863_test\
261261
optional_regression_test\
262262
if_used_test\
263+
int_switch_test\
263264
# bs_uncurry_test
264265
# needs Lam to get rid of Uncurry arity first
265266
# simple_derive_test

jscomp/test/arith_lexer.js

Lines changed: 26 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -24,35 +24,32 @@ function __ocaml_lex_lexeme_rec(lexbuf, ___ocaml_lex_state) {
2424
while(true) {
2525
var __ocaml_lex_state = ___ocaml_lex_state;
2626
var __ocaml_lex_state$1 = Lexing.engine(__ocaml_lex_tables, __ocaml_lex_state, lexbuf);
27-
if (__ocaml_lex_state$1 > 9 || __ocaml_lex_state$1 < 0) {
28-
Curry._1(lexbuf[/* refill_buff */0], lexbuf);
29-
___ocaml_lex_state = __ocaml_lex_state$1;
30-
continue ;
31-
} else {
32-
switch (__ocaml_lex_state$1) {
33-
case 0 :
34-
___ocaml_lex_state = 0;
35-
continue ;
36-
case 1 :
37-
return /* NUMERAL */Block.__(0, [Caml_format.caml_int_of_string(Lexing.lexeme(lexbuf))]);
38-
case 2 :
39-
return /* IDENT */Block.__(1, [Lexing.lexeme(lexbuf)]);
40-
case 3 :
41-
return /* PLUS */0;
42-
case 4 :
43-
return /* MINUS */1;
44-
case 5 :
45-
return /* TIMES */2;
46-
case 6 :
47-
return /* DIVIDE */3;
48-
case 7 :
49-
return /* LPAREN */5;
50-
case 8 :
51-
return /* RPAREN */6;
52-
case 9 :
53-
return /* EOF */7;
54-
55-
}
27+
switch (__ocaml_lex_state$1) {
28+
case 0 :
29+
___ocaml_lex_state = 0;
30+
continue ;
31+
case 1 :
32+
return /* NUMERAL */Block.__(0, [Caml_format.caml_int_of_string(Lexing.lexeme(lexbuf))]);
33+
case 2 :
34+
return /* IDENT */Block.__(1, [Lexing.lexeme(lexbuf)]);
35+
case 3 :
36+
return /* PLUS */0;
37+
case 4 :
38+
return /* MINUS */1;
39+
case 5 :
40+
return /* TIMES */2;
41+
case 6 :
42+
return /* DIVIDE */3;
43+
case 7 :
44+
return /* LPAREN */5;
45+
case 8 :
46+
return /* RPAREN */6;
47+
case 9 :
48+
return /* EOF */7;
49+
default:
50+
Curry._1(lexbuf[/* refill_buff */0], lexbuf);
51+
___ocaml_lex_state = __ocaml_lex_state$1;
52+
continue ;
5653
}
5754
};
5855
}

jscomp/test/arity_infer.js

Lines changed: 23 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -22,32 +22,29 @@ function f1(x) {
2222

2323
function f3(x) {
2424
var tmp;
25-
if (x > 3 || x < 0) {
26-
throw Caml_builtin_exceptions.not_found;
27-
} else {
28-
switch (x) {
29-
case 0 :
30-
tmp = (function (x) {
31-
return x + 1 | 0;
32-
});
33-
break;
34-
case 1 :
35-
tmp = (function (x) {
36-
return x + 2 | 0;
37-
});
38-
break;
39-
case 2 :
40-
tmp = (function (x) {
41-
return x + 3 | 0;
42-
});
43-
break;
44-
case 3 :
45-
tmp = (function (x) {
46-
return x + 4 | 0;
47-
});
48-
break;
49-
50-
}
25+
switch (x) {
26+
case 0 :
27+
tmp = (function (x) {
28+
return x + 1 | 0;
29+
});
30+
break;
31+
case 1 :
32+
tmp = (function (x) {
33+
return x + 2 | 0;
34+
});
35+
break;
36+
case 2 :
37+
tmp = (function (x) {
38+
return x + 3 | 0;
39+
});
40+
break;
41+
case 3 :
42+
tmp = (function (x) {
43+
return x + 4 | 0;
44+
});
45+
break;
46+
default:
47+
throw Caml_builtin_exceptions.not_found;
5148
}
5249
return tmp(3);
5350
}

0 commit comments

Comments
 (0)