-
-
Save MasterDuke17/87f632b6b5c45af82a274961c2c5c941 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/HLL/sprintf.nqp b/src/HLL/sprintf.nqp | |
index 50f80be9e..6f719308e 100644 | |
--- a/src/HLL/sprintf.nqp | |
+++ b/src/HLL/sprintf.nqp | |
@@ -72,7 +72,7 @@ my module sprintf { | |
!! +@*ARGS_HAVE == 1 ?? "1 argument was" | |
!! +@*ARGS_HAVE ~ " arguments were") | |
~ " supplied", nqp::hash('DIRECTIVES_COUNT', | |
- nqp::hash('ARGS_HAVE', +@*ARGS_HAVE, 'ARGS_USED', $*ARGS_USED))) | |
+ nqp::hash('DIRECTIVE', nqp::join('', @statements), 'ARGS_HAVE', +@*ARGS_HAVE, 'ARGS_USED', $*ARGS_USED))) | |
} | |
make nqp::join('', @statements); | |
} | |
@@ -521,10 +521,15 @@ my module sprintf { | |
my $actions := Actions.new(); | |
+ my class Lock is repr('ReentrantMutex') { } | |
sub sprintf($format, @arguments) { | |
+ my $l := Lock.new; | |
+ nqp::lock($l); | |
my @*ARGS_HAVE := @arguments; | |
$assert_used_args := 1; | |
- return Syntax.parse( $format, :actions($actions) ).made; | |
+ my $s := Syntax.parse( $format, :actions($actions) ).made; | |
+ nqp::unlock($l); | |
+ return $s; | |
} | |
nqp::bindcurhllsym('sprintf', &sprintf); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment