@@ -6,19 +6,19 @@ test('interpreter', async t => {
6
6
7
7
t . deepEqual (
8
8
await evalAst ( makeAPI ( { } ) ) ( [ '+' , '1' , '2' , '3' ] ) ,
9
- [ 'atom' , 6 ] ,
9
+ 6 ,
10
10
'Simple expression'
11
11
)
12
12
13
13
t . deepEqual (
14
14
await evalAst ( makeAPI ( { } ) ) ( [ '*' , '2' , '3' , [ '-' , '3' , '4' ] , '2' , [ '/' , '1' , '2' ] ] ) ,
15
- [ 'atom' , - 6 ] ,
15
+ - 6 ,
16
16
'Composed expression'
17
17
)
18
18
19
19
t . deepEqual (
20
- await evalAst ( makeAPI ( { x : [ 'atom' , 5 ] , y : [ 'atom' , 3 ] } ) ) ( [ '*' , 'x' , 'y' , [ '-' , '3' , '4' ] , '2' , [ '/' , '1' , '2' ] ] ) ,
21
- [ 'atom' , - 15 ] ,
20
+ await evalAst ( makeAPI ( { x : 5 , y : 3 } ) ) ( [ '*' , 'x' , 'y' , [ '-' , '3' , '4' ] , '2' , [ '/' , '1' , '2' ] ] ) ,
21
+ - 15 ,
22
22
'Composed expression with env constants'
23
23
)
24
24
@@ -29,20 +29,20 @@ test('interpreter', async t => {
29
29
[ [ 'cat' , '"a"' , '"1"' ] , 11 ] ,
30
30
] ,
31
31
) ,
32
- [ 'atom' , 11 ] ,
32
+ 11 ,
33
33
'Computed operation name'
34
34
)
35
35
36
36
t . deepEqual (
37
- await evalAst ( makeAPI ( { x : [ 'atom' , 5 ] , y : [ 'atom' , 3 ] } ) ) (
37
+ await evalAst ( makeAPI ( { x : 5 , y : 3 } ) ) (
38
38
[ 'process' ,
39
39
[ 'def' , 'a' , '2' ] ,
40
40
[ 'def' , 'b' , '3' ] ,
41
41
[ 'def' , 'x' , [ '+' , 'a' , '3' , 'b' , [ '*' , 'b' , 'a' ] ] ] ,
42
42
[ '+' , 'y' , 'x' ] ,
43
43
]
44
44
) ,
45
- [ 'atom' , 17 ] ,
45
+ 17 ,
46
46
'Process expression with env constants'
47
47
)
48
48
@@ -53,7 +53,7 @@ test('interpreter', async t => {
53
53
[ 'identity' , 7 ] ,
54
54
]
55
55
) ,
56
- [ 'atom' , 7 ] ,
56
+ 7 ,
57
57
'Identity procedure definition / application'
58
58
)
59
59
@@ -67,7 +67,7 @@ test('interpreter', async t => {
67
67
[ 'inc' , 7 ] ,
68
68
]
69
69
) ,
70
- [ 'atom' , 8 ] ,
70
+ 8 ,
71
71
'Procedure declaration / application'
72
72
)
73
73
@@ -81,7 +81,7 @@ test('interpreter', async t => {
81
81
[ 'sum' , 7 , 8 ] ,
82
82
]
83
83
) ,
84
- [ 'atom' , 15 ] ,
84
+ 15 ,
85
85
'Multiparameter procedure declaration / application'
86
86
)
87
87
@@ -103,19 +103,19 @@ test('interpreter', async t => {
103
103
[ 'sqrt' , 9 ] ,
104
104
]
105
105
) ,
106
- [ 'atom' , 3 ] ,
106
+ 3 ,
107
107
'Procedure recursion'
108
108
)
109
109
110
110
t . deepEqual (
111
111
await evalAst ( makeAPI ( { } ) ) ( [ '+' , [ '*' , '1' , '2' , '3' ] , '2' , [ '/' , '27' , '3' , '3' ] ] ) ,
112
- [ 'atom' , 11 ] ,
112
+ 11 ,
113
113
'Mathematical operators'
114
114
)
115
115
116
116
t . deepEqual (
117
117
await evalAst ( makeAPI ( { } ) ) ( [ 'or' , [ 'and' , 'true' , [ '>' , '3' , '4' ] ] , 'false' , [ '<' , '27' , '3' ] , [ 'or' , 'true' , 'false' , 'false' ] ] ) ,
118
- [ 'atom' , true ] ,
118
+ true ,
119
119
'Logical operators'
120
120
)
121
121
@@ -127,7 +127,7 @@ test('interpreter', async t => {
127
127
[ 'Math' , 'a' , [ 'Math' , 'b' ] ] ,
128
128
]
129
129
) ,
130
- [ 'atom' , 1 ] ,
130
+ 1 ,
131
131
'Math operators with evaluated name'
132
132
)
133
133
@@ -137,7 +137,7 @@ test('interpreter', async t => {
137
137
[ 'Math' , '.log' , [ 'Math' , '.E' ] ] ,
138
138
]
139
139
) ,
140
- [ 'atom' , 1 ] ,
140
+ 1 ,
141
141
'Math operators with known name'
142
142
)
143
143
@@ -153,7 +153,7 @@ test('interpreter', async t => {
153
153
[ '+' , 'x' , 8 ] ,
154
154
]
155
155
) ,
156
- [ 'atom' , 20 ] ,
156
+ 20 ,
157
157
'Process application / definition'
158
158
)
159
159
@@ -166,7 +166,7 @@ test('interpreter', async t => {
166
166
[ 'else' , [ '+' , 12 , 3 ] ] ,
167
167
]
168
168
) ,
169
- [ 'atom' , 10 ] ,
169
+ 10 ,
170
170
'Case analysis'
171
171
)
172
172
@@ -180,7 +180,7 @@ test('interpreter', async t => {
180
180
[ 'else' , [ '+' , 12 , 3 ] ] ,
181
181
]
182
182
) ,
183
- [ 'atom' , 15 ] ,
183
+ 15 ,
184
184
'Case analysis - else'
185
185
)
186
186
@@ -192,7 +192,7 @@ test('interpreter', async t => {
192
192
[ '+' , 12 , 3 ] ,
193
193
]
194
194
) ,
195
- [ 'atom' , 10 ] ,
195
+ 10 ,
196
196
'Conditional'
197
197
)
198
198
@@ -204,23 +204,23 @@ test('interpreter', async t => {
204
204
[ '+' , 12 , 3 ] ,
205
205
]
206
206
) ,
207
- [ 'atom' , 15 ] ,
207
+ 15 ,
208
208
'Conditional - else'
209
209
)
210
210
211
211
t . deepEqual (
212
212
await evalAst ( makeAPI ( { } ) ) (
213
213
[ [ '->' , [ 'x' , 'y' ] , [ '+' , 'x' , 'y' ] ] , 23 , 34 ] ,
214
214
) ,
215
- [ 'atom' , 57 ] ,
215
+ 57 ,
216
216
'Lambda definition and application'
217
217
)
218
218
219
219
t . deepEqual (
220
220
await evalAst ( makeAPI ( { } ) ) (
221
221
[ [ '->' , 'param' , [ '+' , 'param' , '10' ] ] , 23 ] ,
222
222
) ,
223
- [ 'atom' , 33 ] ,
223
+ 33 ,
224
224
'Lambda definition and application (one parameter)'
225
225
)
226
226
@@ -234,7 +234,7 @@ test('interpreter', async t => {
234
234
3
235
235
] ,
236
236
) ,
237
- [ 'atom' , 10 ] ,
237
+ 10 ,
238
238
'Function composition operator'
239
239
)
240
240
@@ -248,7 +248,7 @@ test('interpreter', async t => {
248
248
3
249
249
] ,
250
250
) ,
251
- [ 'atom' , 12 ] ,
251
+ 12 ,
252
252
'Inverse function composition operator'
253
253
)
254
254
@@ -260,7 +260,7 @@ test('interpreter', async t => {
260
260
'key3' , '"value3"' ,
261
261
] ,
262
262
) ,
263
- [ 'atom' , { key1 : 'value1' , key2 : 2 , key3 : 'value3' } ] ,
263
+ { key1 : 'value1' , key2 : 2 , key3 : 'value3' } ,
264
264
'Key-Value (kv) constructor operator'
265
265
)
266
266
@@ -273,7 +273,7 @@ test('interpreter', async t => {
273
273
'key4' , [ 'cat' , '"value"' , [ '+' , '2' , '2' ] ] ,
274
274
] ,
275
275
) ,
276
- [ 'atom' , { key1 : 'value1' , key2 : 2 , key3 : 3 , key4 : 'value4' } ] ,
276
+ { key1 : 'value1' , key2 : 2 , key3 : 3 , key4 : 'value4' } ,
277
277
'Key-Value Object (kv) constructor operator with evaluated arguments'
278
278
)
279
279
@@ -287,7 +287,7 @@ test('interpreter', async t => {
287
287
[ '-' , '10' , '5' ] ,
288
288
] ,
289
289
) ,
290
- [ 'atom' , [ 1 , 5 , 3 , 4 , 5 ] ] ,
290
+ [ 1 , 5 , 3 , 4 , 5 ] ,
291
291
'List (ls) constructor operator with evaluated arguments'
292
292
)
293
293
@@ -298,7 +298,7 @@ test('interpreter', async t => {
298
298
'"key"' , '"a"' , '"b"' ,
299
299
] ,
300
300
) ,
301
- [ 'atom' , 12 ] ,
301
+ 12 ,
302
302
'Get (get) general getter for objects and lists'
303
303
)
304
304
@@ -313,7 +313,7 @@ test('interpreter', async t => {
313
313
[ 'get' , 'a' , '"key"' , '"a"' , '"b"' ] ,
314
314
] ,
315
315
) ,
316
- [ 'atom' , 21 ] ,
316
+ 21 ,
317
317
'Set (set) general setter for objects and lists'
318
318
)
319
319
0 commit comments