We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 43d512a commit 981edbcCopy full SHA for 981edbc
src5/lib/Perlito5/FoldConstant.pm
@@ -54,6 +54,15 @@ sub fold_constant {
54
return Perlito5::AST::Num->new(num => $v);
55
}
56
57
+ if ($code eq 'infix:</>') {
58
+ if (is_constant($arg0) && is_constant($arg1)) {
59
+ my $v = $arg0->value / $arg1->value;
60
+ if ($v == int($v)) {
61
+ return Perlito5::AST::Int->new(int => $v);
62
+ }
63
+ return Perlito5::AST::Num->new(num => $v);
64
65
66
if ($code eq 'infix:<**>') {
67
if (is_constant($arg0) && is_constant($arg1)) {
68
my $v = $arg0->value ** $arg1->value;
0 commit comments