From b4ec49d31d68c7f854559bf2751705b35cc1f306 Mon Sep 17 00:00:00 2001 From: Tom Browder Date: Fri, 12 Jan 2018 21:13:33 -0600 Subject: [PATCH] all ints converted to bigint --- src/Perl6/Pod.nqp | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/src/Perl6/Pod.nqp b/src/Perl6/Pod.nqp index 47d90006170..3d1f354f64d 100644 --- a/src/Perl6/Pod.nqp +++ b/src/Perl6/Pod.nqp @@ -111,23 +111,6 @@ class Perl6::Pod { ).compile_time_value } - sub decint($s) { - # code copied from Actions.nqp and locally modified - my int $base := 10; - my int $chars := nqp::chars($s); - $chars > $max-dec-intchars - ?? string_to_bigint($s, $base, $chars) - !! string_to_int($s, $base, $chars); - } - - sub string_to_int($src, int $base, int $chars) { - # code copied from Actions.nqp and locally modified - my $res := nqp::radix($base, ~$src, 0, 2); - $src.panic("'$src' is not a valid number") - unless nqp::iseq_i(nqp::atpos($res, 2), $chars); - nqp::box_i(nqp::atpos($res, 0), $*W.find_symbol(['Int'])); - } - sub string_to_bigint($src, int $base, int $chars) { # code copied from Actions.nqp and locally modified my $res := nqp::radix_I($base, ~$src, 0, 2, $*W.find_symbol(['Int'])); @@ -149,7 +132,8 @@ class Perl6::Pod { $s ~~ /^ <[+-]>? \d+ % '_' $/ { # decint say(" element type is Int (dec)") if $debugp; - my $val := decint($s); + my int $base := 10; + my $val := string_to_bigint($s, $base, nqp::chars($s)); @arr.push($val); } #=== numbers ====================================================================