@@ -84,10 +84,10 @@ my module sprintf {
84
84
nqp :: throw ($ ex );
85
85
}
86
86
87
- sub bad-type-for-directive ($ type , $ directive ) {
88
- my $ message := " Directive $ directive not applicable for type " ~ $ type . HOW . name ($ type );
87
+ sub bad-type-for-directive ($ type , $ directive , $ value ) {
88
+ my $ message := " Directive $ directive not applicable for value of type " ~ $ type . HOW . name ($ type ) ~ " ( $ value ) " ;
89
89
my $ payload := nqp ::hash(' BAD_TYPE_FOR_DIRECTIVE' ,
90
- nqp ::hash(' TYPE' , $ type . HOW . name ($ type ), ' DIRECTIVE' , $ directive ));
90
+ nqp ::hash(' TYPE' , $ type . HOW . name ($ type ), ' DIRECTIVE' , $ directive , ' VALUE ' , $ value ));
91
91
panic($ message , $ payload );
92
92
}
93
93
@@ -178,7 +178,7 @@ my module sprintf {
178
178
method directive :sym <b >($/ ) {
179
179
my $ next := next_argument($/ );
180
180
CATCH {
181
- bad-type-for-directive($ next , ' b' );
181
+ bad-type-for-directive($ next , ' b' , @ * ARGS_HAVE );
182
182
}
183
183
my $ int := intify($ next );
184
184
my $ pad := padding_char($/ );
@@ -208,15 +208,15 @@ my module sprintf {
208
208
method directive :sym <c >($/ ) {
209
209
my $ next := next_argument($/ );
210
210
CATCH {
211
- bad-type-for-directive($ next , ' c' );
211
+ bad-type-for-directive($ next , ' c' , @ * ARGS_HAVE );
212
212
}
213
213
make nqp :: chr (intify($ next ))
214
214
}
215
215
216
216
method directive :sym <d >($/ ) {
217
217
my $ next := next_argument($/ );
218
218
CATCH {
219
- bad-type-for-directive($ next , ' d' );
219
+ bad-type-for-directive($ next , ' d' , @ * ARGS_HAVE );
220
220
}
221
221
my $ int := intify($ next );
222
222
my $ pad := padding_char($/ );
@@ -401,7 +401,7 @@ my module sprintf {
401
401
method directive :sym <e >($/ ) {
402
402
my $ next := next_argument($/ );
403
403
CATCH {
404
- bad-type-for-directive($ next , ' e' );
404
+ bad-type-for-directive($ next , ' e' , @ * ARGS_HAVE );
405
405
}
406
406
my $ float := floatify($ next );
407
407
my $ precision := $ < precision > ?? $ < precision > . made !! 6 ;
@@ -412,7 +412,7 @@ my module sprintf {
412
412
method directive :sym <f >($/ ) {
413
413
my $ next := next_argument($/ );
414
414
CATCH {
415
- bad-type-for-directive($ next , ' f' );
415
+ bad-type-for-directive($ next , ' f' , @ * ARGS_HAVE );
416
416
}
417
417
my $ int := floatify($ next );
418
418
my $ precision := $ < precision > ?? $ < precision > . made !! 6 ;
@@ -423,7 +423,7 @@ my module sprintf {
423
423
method directive :sym <g >($/ ) {
424
424
my $ next := next_argument($/ );
425
425
CATCH {
426
- bad-type-for-directive($ next , ' g' );
426
+ bad-type-for-directive($ next , ' g' , @ * ARGS_HAVE );
427
427
}
428
428
my $ float := floatify($ next );
429
429
my $ precision := $ < precision > ?? $ < precision > . made !! 6 ;
@@ -434,7 +434,7 @@ my module sprintf {
434
434
method directive :sym <o >($/ ) {
435
435
my $ next := next_argument($/ );
436
436
CATCH {
437
- bad-type-for-directive($ next , ' o' );
437
+ bad-type-for-directive($ next , ' o' , @ * ARGS_HAVE );
438
438
}
439
439
my $ int := intify($ next );
440
440
$ int := nqp ::base_I($ int , 8 );
@@ -453,7 +453,7 @@ my module sprintf {
453
453
method directive :sym <s >($/ ) {
454
454
my $ next := next_argument($/ );
455
455
CATCH {
456
- bad-type-for-directive($ next , ' s' );
456
+ bad-type-for-directive($ next , ' s' , @ * ARGS_HAVE );
457
457
}
458
458
my $ string := $ next ;
459
459
if nqp :: chars ($ < precision > ) && nqp :: chars ($ string ) > $ < precision > . made {
@@ -466,7 +466,7 @@ my module sprintf {
466
466
method directive :sym <u >($/ ) {
467
467
my $ next := next_argument($/ );
468
468
CATCH {
469
- bad-type-for-directive($ next , ' u' );
469
+ bad-type-for-directive($ next , ' u' , @ * ARGS_HAVE );
470
470
}
471
471
my $ int := intify($ next );
472
472
if nqp ::islt_I($ int , $ zero ) {
@@ -480,7 +480,7 @@ my module sprintf {
480
480
method directive :sym <x >($/ ) {
481
481
my $ next := next_argument($/ );
482
482
CATCH {
483
- bad-type-for-directive($ next , ' x' );
483
+ bad-type-for-directive($ next , ' x' , @ * ARGS_HAVE );
484
484
}
485
485
my $ int := intify($ next );
486
486
$ int := nqp ::base_I($ int , 16 );
0 commit comments