git.s-ol.nu alive / 89fa02a
lib: fix array-/map s-ol 6 months ago
1 changed file(s) with 8 addition(s) and 8 deletion(s). Raw diff Collapse all Expand all
254254 tail = [L\push t\eval, scope for t in *tail]
255255 { array, fn } = tail
256256
257 fndef = fn.result
258257 assert fn\type! == T.fndef, "fn has to be a fndef"
258
259259 array_type = array\type!
260260 assert array_type.__class == Array, Error 'argument', "expected an Array"
261261
263263 tag_o = @tag\clone Tag.parse tostring i
264264 tag_i = @tag\clone tag_o
265265 Cell tag_o, {
266 with Constant.literal T.fndef, fndef!, 'fn'
267 .meta = fndef.meta
266 Dummy fn\make_ref!
268267 Cell tag_i, {
269 Constant.literal T.opdef, get!, 'get'
270 Constant.literal array_type, array.result!, 'array'
268 Dummy.literal T.opdef, get!
269 Dummy array\make_ref!
271270 Constant.num i-1
272271 }
273272 }
274273
275274 tag = @tag\clone Tag.parse '-1'
276275 inner = Cell tag, {
277 Constant.literal T.opdef, array_constr, 'array'
276 Dummy.literal T.opdef, array_constr
278277 unpack invocations
279278 }
280 super inner\eval scope
281
279
280 node = inner\eval scope
281 super RTNode children: { array, fn, node }, result: node.result
282282
283283 Constant.meta
284284 meta: