timo / json_fast

a naive imperative json parser in perl6, to evaluate performance against JSON::Tiny
Artistic License 2.0
26 stars 20 forks source link

error when installing module #80

Open brandonm78 opened 2 years ago

brandonm78 commented 2 years ago

Im trying to install this module on Ubuntu version 20 and getting the following error. Any help would be appreciated.

:~/ronin/raku$ zef install https://github.com/timo/json_fast.git ===> Testing: JSON::Fast:ver<0.17>:auth [JSON::Fast] Cannot resolve caller subst(Str:D: Str:D, :global); none of these signatures match: [JSON::Fast] (Str:D: Str:D $original, Str:D $final, %options) [JSON::Fast] (Str:D: $matcher, $replacement, %options) [JSON::Fast] in block at t/13-scopes.t line 6 ===> Testing [FAIL]: JSON::Fast:ver<0.17>:auth Aborting due to test failure: JSON::Fast:ver<0.17>:auth (use --force-test to override)

coke commented 1 year ago

What version of raku do you have? Current version is now 2023.04

timo commented 1 year ago
commit dfb563af782fb93935e1dc74a8dbd512d25b626f
Author: Elizabeth Mattijsen <liz@wenzperl.nl>
Date:   Fri Nov 8 15:48:54 2019 +0100

    Allow for 1 positional arg .subst

    Not specifying a replacement means the empty string, aka, removing
    the matched string(s).  Wonder why we didn't think about that before.

diff --git a/src/core.c/Cool.pm6 b/src/core.c/Cool.pm6
index 098321054..30409abe1 100644
--- a/src/core.c/Cool.pm6
+++ b/src/core.c/Cool.pm6
@@ -322,7 +322,7 @@ my class Cool { # declared in BOOTSTRAP
         $/ := nqp::getlexcaller('$/');
         {*}
     }
-    multi method subst(Cool:D: $original, $replacement, *%options) {
+    multi method subst(Cool:D: $original, $replacement = "", *%options) {
         $/ := nqp::getlexcaller('$/');
         self.Stringy.subst($original, $replacement, |%options);
     }

this commit added the ability to use subst without a second argument to get "" as default. This is only used in test code, so I'm just going to make it backwards compatible I think.