@@ -269,33 +269,38 @@ class QAST::Compiler is HLL::Compiler {
269
269
# Generate parameter handling code.
270
270
my $ decls := self . post_new(' Ops' );
271
271
my % lex_params ;
272
- for $ block . params {
273
- my @ param := [' .param' ];
274
-
275
- if $ _ . scope eq ' local' {
276
- nqp :: push (@ param , $ block . local_type_long($ _ . name ));
277
- nqp :: push (@ param , $ _ . name );
278
- }
279
- else {
280
- my $ reg := $ block . lex_reg($ _ . name );
281
- nqp :: push (@ param , $ block . lexical_type_long($ _ . name ));
282
- nqp :: push (@ param , $ reg );
283
- % lex_params {$ _ . name } := $ reg ;
284
- }
285
-
286
- if $ _ . slurpy {
287
- nqp :: push (@ param , ' :slurpy' );
288
- if $ _ . named {
289
- nqp :: push (@ param , ' :named' );
272
+ if $ node . custom_args {
273
+ $ decls . push_pirop(' .param pmc CALL_SIG :call_sig' );
274
+ }
275
+ else {
276
+ for $ block . params {
277
+ my @ param := [' .param' ];
278
+
279
+ if $ _ . scope eq ' local' {
280
+ nqp :: push (@ param , $ block . local_type_long($ _ . name ));
281
+ nqp :: push (@ param , $ _ . name );
290
282
}
283
+ else {
284
+ my $ reg := $ block . lex_reg($ _ . name );
285
+ nqp :: push (@ param , $ block . lexical_type_long($ _ . name ));
286
+ nqp :: push (@ param , $ reg );
287
+ % lex_params {$ _ . name } := $ reg ;
288
+ }
289
+
290
+ if $ _ . slurpy {
291
+ nqp :: push (@ param , ' :slurpy' );
292
+ if $ _ . named {
293
+ nqp :: push (@ param , ' :named' );
294
+ }
295
+ }
296
+ elsif $ _ . named {
297
+ nqp :: push (@ param , ' :named(' ~ self . escape($ _ . named) ~ ' )' );
298
+ }
299
+
300
+ $ decls . push_pirop(pir:: join (' ' , @ param ));
291
301
}
292
- elsif $ _ . named {
293
- nqp :: push (@ param , ' :named(' ~ self . escape($ _ . named) ~ ' )' );
294
- }
295
-
296
- $ decls . push_pirop(pir:: join (' ' , @ param ));
297
302
}
298
-
303
+
299
304
# Generate declarations.
300
305
for $ block . lexicals {
301
306
$ decls . push_pirop(' .lex ' ~ self . escape($ _ . name ) ~ ' , ' ~ $ block . lex_reg($ _ . name ));
0 commit comments