forked from rescript-lang/rescript
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathformat_regression.js
77 lines (68 loc) · 1.75 KB
/
format_regression.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
// Generated CODE, PLEASE EDIT WITH CARE
'use strict';
var Caml_builtin_exceptions = require("../runtime/caml_builtin_exceptions");
var Caml_curry = require("../runtime/caml_curry");
function peek_queue() {
throw [
Caml_builtin_exceptions.assert_failure,
[
"format_regression.ml",
10,
19
]
];
}
function int_of_size() {
throw [
Caml_builtin_exceptions.assert_failure,
[
"format_regression.ml",
11,
20
]
];
}
function take_queue() {
throw [
Caml_builtin_exceptions.assert_failure,
[
"format_regression.ml",
12,
19
]
];
}
function format_pp_token(_, _$1) {
throw [
Caml_builtin_exceptions.assert_failure,
[
"format_regression.ml",
13,
26
]
];
}
function advance_loop(state) {
while(true) {
var match = peek_queue(state[/* pp_queue */3]);
var size = match[/* elem_size */0];
var size$1 = int_of_size(size);
if (size$1 < 0 && state[/* pp_right_total */2] - state[/* pp_left_total */1] < state[/* pp_space_left */0]) {
return 0;
}
else {
take_queue(state[/* pp_queue */3]);
Caml_curry.app1(format_pp_token(state, size$1 < 0 ? 1000000010 : size$1), match[/* token */1]);
state[/* pp_left_total */1] = match[/* length */2] + state[/* pp_left_total */1] | 0;
continue ;
}
};
}
var pp_infinity = 1000000010;
exports.peek_queue = peek_queue;
exports.int_of_size = int_of_size;
exports.take_queue = take_queue;
exports.format_pp_token = format_pp_token;
exports.pp_infinity = pp_infinity;
exports.advance_loop = advance_loop;
/* No side effect */