Skip to content

Commit

Permalink
Merge pull request #5 from timo/patch-1
Browse files Browse the repository at this point in the history
chase rakudo changes, up version.
  • Loading branch information
FROGGS committed Aug 18, 2017
2 parents 91b6036 + 82946e9 commit 9bbfc7a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion META6.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"perl" : "6.*",
"name" : "overload::constant",
"author" : "github:FROGGS",
"version" : "0.0.1",
"version" : "0.0.2",
"description" : "allows to intercept parsing of num/str literals",
"depends" : [ ],
"provides" : {
Expand Down
11 changes: 6 additions & 5 deletions lib/overload/constant.pm
Original file line number Diff line number Diff line change
Expand Up @@ -17,28 +17,29 @@ sub EXPORT(*@handlers) {
}
}
if atkeyish($/, 'integer') -> $v {
$/.'!make'( %handlers<integer>
$/.make( %handlers<integer>
?? call-handler(%handlers<integer>(nqp::p6box_s($v.Str)))
!! $*W.add_numeric_constant($/, 'Int', $v.made) )
}
elsif atkeyish($/, 'dec_number') -> $v {
$/.'!make'( %handlers<decimal>
$/.make( %handlers<decimal>
?? call-handler(%handlers<decimal>(nqp::p6box_s($v.Str)))
!! $v.made )
}
elsif atkeyish($/, 'rad_number') -> $v {
$/.'!make'( %handlers<radix>
$/.make( %handlers<radix>
?? call-handler(%handlers<radix>(nqp::p6box_s($v.Str)))
!! $v.made )
}
else {
$/.'!make'( %handlers<numish>
$/.make( %handlers<numish>
?? call-handler(%handlers<numish>(nqp::p6box_s($/.Str)))
!! $*W.add_numeric_constant($/, 'Num', +nqp::p6box_s($/.Str)) )
}
}
}
nqp::bindkey(%*LANG, 'MAIN-actions', %*LANG<MAIN-actions>.HOW.mixin(%*LANG<MAIN-actions>, Numish[%handlers]));

$*LANG.refine_slang('MAIN', role {}, Numish[%handlers]);

{}
}

0 comments on commit 9bbfc7a

Please sign in to comment.