@@ -331,6 +331,16 @@ QAST::Operations.add_core_op('bind', -> $qastcomp, $op {
331
331
});
332
332
333
333
# Calling.
334
+ sub handle_arg ($ arg , $ qastcomp , $ ops , @ arg_results ) {
335
+ my $ arg_post := $ qastcomp . as_post($ arg );
336
+ $ ops . push ($ arg_post );
337
+ my $ result := $ arg_post . result;
338
+ if $ arg . named -> $ name {
339
+ $ result := $ result ~ " :named(" ~ $ qastcomp . escape($ name ) ~ " )" ;
340
+ }
341
+ @ arg_results . push ($ result );
342
+ }
343
+
334
344
QAST ::Operations. add_core_op(' call' , -> $ qastcomp , $ op {
335
345
# Work out what callee is.
336
346
my $ callee ;
@@ -349,13 +359,7 @@ QAST::Operations.add_core_op('call', -> $qastcomp, $op {
349
359
my $ ops := $ qastcomp . post_new(' Ops' );
350
360
my @ arg_results ;
351
361
for @ args {
352
- my $ arg_post := $ qastcomp . as_post($ _ );
353
- $ ops . push ($ arg_post );
354
- my $ result := $ arg_post . result;
355
- if $ _ . named -> $ name {
356
- $ result := $ result ~ " :named(" ~ $ qastcomp . escape($ name ) ~ " )" ;
357
- }
358
- @ arg_results . push ($ result );
362
+ handle_arg($ _ , $ qastcomp , $ ops , @ arg_results );
359
363
}
360
364
361
365
# Figure out result register type and allocate a register for it.
@@ -395,13 +399,7 @@ QAST::Operations.add_core_op('callmethod', -> $qastcomp, $op {
395
399
my $ ops := $ qastcomp . post_new(' Ops' );
396
400
my @ arg_results ;
397
401
for @ args {
398
- my $ arg_post := $ qastcomp . as_post($ _ );
399
- $ ops . push ($ arg_post );
400
- my $ result := $ arg_post . result;
401
- if $ _ . named -> $ name {
402
- $ result := $ result ~ " :named(" ~ $ qastcomp . escape($ name ) ~ " )" ;
403
- }
404
- @ arg_results . push ($ result );
402
+ handle_arg($ _ , $ qastcomp , $ ops , @ arg_results );
405
403
}
406
404
407
405
# Figure out result register type and allocate a register for it.
0 commit comments