Skip to content

Instantly share code, notes, and snippets.

@dogbert17
Created November 7, 2021 17:40
Show Gist options
  • Save dogbert17/7bfbdc82f605d5b9aed15ff62c6d00cf to your computer and use it in GitHub Desktop.
Save dogbert17/7bfbdc82f605d5b9aed15ff62c6d00cf to your computer and use it in GitHub Desktop.
Changes
dogbert@dogbert-VirtualBox:~/repos/rakudo/nqp$ git diff
diff --git a/src/HLL/sprintf.nqp b/src/HLL/sprintf.nqp
index 0c34b976b..307dff86d 100644
--- a/src/HLL/sprintf.nqp
+++ b/src/HLL/sprintf.nqp
@@ -1,6 +1,5 @@
my module sprintf {
my @handlers;
- my $assert_used_args;
grammar Syntax {
token TOP {
@@ -64,7 +63,7 @@ my module sprintf {
my @statements;
@statements.push( $_.made ) for $<statement>;
- if ($assert_used_args && $*ARGS_USED < +@*ARGS_HAVE) || ($*ARGS_USED > +@*ARGS_HAVE) {
+ if ($*assert_used_args && $*ARGS_USED < +@*ARGS_HAVE) || ($*ARGS_USED > +@*ARGS_HAVE) {
panic("Your printf-style directives specify "
~ ($*ARGS_USED == 1 ?? "1 argument, but "
!! "$*ARGS_USED arguments, but ")
@@ -101,7 +100,7 @@ my module sprintf {
sub next_argument($/) {
if $<idx> {
- $assert_used_args := 0;
+ $*assert_used_args := 0;
@*ARGS_HAVE[$<idx>.made]
}
else {
@@ -622,7 +621,7 @@ my module sprintf {
sub sprintf($format, @arguments) {
my @*ARGS_HAVE := @arguments;
- $assert_used_args := 1;
+ my $*assert_used_args := 1;
return Syntax.parse( $format, :actions($actions) ).made;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment