@@ -45,14 +45,14 @@ Three.prototype.cons = function (value) {
45
45
return new Four ( value , this . a , this . b , this . c ) ;
46
46
} ;
47
47
48
- Three . prototype . node = function ( M ) {
48
+ Three . prototype . _node = function ( M ) {
49
49
return new Node3 ( this . measure ( M ) , this . a , this . b , this . c ) ;
50
50
} ;
51
51
52
52
/**
53
53
* It is assumed that p(i+|this|) is true.
54
54
*/
55
- Three . prototype . splitDigit = function ( p , i , M ) {
55
+ Three . prototype . _splitDigit = function ( p , i , M ) {
56
56
assert ( p ( M . plus ( i , this . measure ( M ) ) ) ) ; // /!\ Potential Heisenbug generator.
57
57
i = M . plus ( i , M . measure ( this . a ) ) ;
58
58
if ( p ( i ) ) return new Split ( [ ] , this . a , [ this . b , this . c ] ) ;
@@ -72,17 +72,21 @@ Three.prototype._nodes_with_one = function (M, other) {
72
72
73
73
Three . prototype . _nodes_with_two = function ( M , other ) {
74
74
assert ( other instanceof Two ) ;
75
- return [ other . node ( M ) , this . node ( M ) ] ;
75
+ return [ other . _node ( M ) , this . _node ( M ) ] ;
76
76
} ;
77
77
78
78
Three . prototype . _nodes_with_three = function ( M , other ) {
79
79
assert ( other instanceof Three ) ;
80
- return [ other . node ( M ) , this . node ( M ) ] ;
80
+ return [ other . _node ( M ) , this . _node ( M ) ] ;
81
81
} ;
82
82
83
83
Three . prototype . _nodes_with_four = function ( M , other ) {
84
84
assert ( other instanceof Four ) ;
85
- return [ node2 ( M , other . a , other . b ) , node2 ( M , other . c , other . d ) , this . node ( M ) ] ;
85
+ return [
86
+ node2 ( M , other . a , other . b ) ,
87
+ node2 ( M , other . c , other . d ) ,
88
+ this . _node ( M ) ,
89
+ ] ;
86
90
} ;
87
91
88
92
Three . prototype . _nodes_with_list = function ( M , list , other ) {
@@ -95,20 +99,20 @@ Three.prototype._nodes_with_list_and_one = function (M, list, other) {
95
99
// eslint-disable-next-line default-case
96
100
switch ( list . length ) {
97
101
case 1 :
98
- return [ node2 ( M , other . a , list [ 0 ] ) , this . node ( M ) ] ;
102
+ return [ node2 ( M , other . a , list [ 0 ] ) , this . _node ( M ) ] ;
99
103
case 2 :
100
- return [ node3 ( M , other . a , list [ 0 ] , list [ 1 ] ) , this . node ( M ) ] ;
104
+ return [ node3 ( M , other . a , list [ 0 ] , list [ 1 ] ) , this . _node ( M ) ] ;
101
105
case 3 :
102
106
return [
103
107
node2 ( M , other . a , list [ 0 ] ) ,
104
108
node2 ( M , list [ 1 ] , list [ 2 ] ) ,
105
- this . node ( M ) ,
109
+ this . _node ( M ) ,
106
110
] ;
107
111
case 4 :
108
112
return [
109
113
node3 ( M , other . a , list [ 0 ] , list [ 1 ] ) ,
110
114
node2 ( M , list [ 2 ] , list [ 3 ] ) ,
111
- this . node ( M ) ,
115
+ this . _node ( M ) ,
112
116
] ;
113
117
}
114
118
} ;
@@ -119,16 +123,20 @@ Three.prototype._nodes_with_list_and_two = function (M, list, other) {
119
123
// eslint-disable-next-line default-case
120
124
switch ( list . length ) {
121
125
case 1 :
122
- return [ node3 ( M , other . a , other . b , list [ 0 ] ) , this . node ( M ) ] ;
126
+ return [ node3 ( M , other . a , other . b , list [ 0 ] ) , this . _node ( M ) ] ;
123
127
case 2 :
124
- return [ other . node ( M ) , node2 ( M , list [ 0 ] , list [ 1 ] ) , this . node ( M ) ] ;
128
+ return [ other . _node ( M ) , node2 ( M , list [ 0 ] , list [ 1 ] ) , this . _node ( M ) ] ;
125
129
case 3 :
126
- return [ other . node ( M ) , node3 ( M , list [ 0 ] , list [ 1 ] , list [ 2 ] ) , this . node ( M ) ] ;
130
+ return [
131
+ other . _node ( M ) ,
132
+ node3 ( M , list [ 0 ] , list [ 1 ] , list [ 2 ] ) ,
133
+ this . _node ( M ) ,
134
+ ] ;
127
135
case 4 :
128
136
return [
129
137
node3 ( M , other . a , other . b , list [ 0 ] ) ,
130
138
node3 ( M , list [ 1 ] , list [ 2 ] , list [ 3 ] ) ,
131
- this . node ( M ) ,
139
+ this . _node ( M ) ,
132
140
] ;
133
141
}
134
142
} ;
@@ -142,18 +150,22 @@ Three.prototype._nodes_with_list_and_three = function (M, list, other) {
142
150
return [
143
151
node2 ( M , other . a , other . b ) ,
144
152
node2 ( M , other . c , list [ 0 ] ) ,
145
- this . node ( M ) ,
153
+ this . _node ( M ) ,
146
154
] ;
147
155
case 2 :
148
- return [ other . node ( M ) , node2 ( M , list [ 0 ] , list [ 1 ] ) , this . node ( M ) ] ;
156
+ return [ other . _node ( M ) , node2 ( M , list [ 0 ] , list [ 1 ] ) , this . _node ( M ) ] ;
149
157
case 3 :
150
- return [ other . node ( M ) , node3 ( M , list [ 0 ] , list [ 1 ] , list [ 2 ] ) , this . node ( M ) ] ;
158
+ return [
159
+ other . _node ( M ) ,
160
+ node3 ( M , list [ 0 ] , list [ 1 ] , list [ 2 ] ) ,
161
+ this . _node ( M ) ,
162
+ ] ;
151
163
case 4 :
152
164
return [
153
- other . node ( M ) ,
165
+ other . _node ( M ) ,
154
166
node2 ( M , list [ 0 ] , list [ 1 ] ) ,
155
167
node2 ( M , list [ 2 ] , list [ 3 ] ) ,
156
- this . node ( M ) ,
168
+ this . _node ( M ) ,
157
169
] ;
158
170
}
159
171
} ;
@@ -167,27 +179,27 @@ Three.prototype._nodes_with_list_and_four = function (M, list, other) {
167
179
return [
168
180
node2 ( M , other . a , other . b ) ,
169
181
node3 ( M , other . c , other . d , list [ 0 ] ) ,
170
- this . node ( M ) ,
182
+ this . _node ( M ) ,
171
183
] ;
172
184
case 2 :
173
185
return [
174
186
node3 ( M , other . a , other . b , other . c ) ,
175
187
node3 ( M , other . d , list [ 0 ] , list [ 1 ] ) ,
176
- this . node ( M ) ,
188
+ this . _node ( M ) ,
177
189
] ;
178
190
case 3 :
179
191
return [
180
192
node2 ( M , other . a , other . b ) ,
181
193
node2 ( M , other . c , other . d ) ,
182
194
node3 ( M , list [ 0 ] , list [ 1 ] , list [ 2 ] ) ,
183
- this . node ( M ) ,
195
+ this . _node ( M ) ,
184
196
] ;
185
197
case 4 :
186
198
return [
187
199
node3 ( M , other . a , other . b , other . c ) ,
188
200
node2 ( M , other . d , list [ 0 ] ) ,
189
201
node3 ( M , list [ 1 ] , list [ 2 ] , list [ 3 ] ) ,
190
- this . node ( M ) ,
202
+ this . _node ( M ) ,
191
203
] ;
192
204
}
193
205
} ;
0 commit comments