Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
added overload.pm, only "" right now
  • Loading branch information
FROGGS committed Jun 15, 2013
1 parent cd6b480 commit 34fbe88
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/Perl5/Actions.nqp
Expand Up @@ -6133,7 +6133,7 @@ class Perl5::QActions is HLL::Actions does STDActions {
}
@asts.push($_.ast<ww_atom>
?? $_.ast
!! QAST::Op.new( :op('callmethod'), :name('P5Str'), $_.ast ));
!! QAST::Op.new( :op('call'), :name('&prefix:<P5~>'), $_.ast ));
}
else {
$lastlit := $lastlit ~ $_.ast;
Expand Down
8 changes: 7 additions & 1 deletion lib/Perl5/Terms.pm
Expand Up @@ -137,7 +137,8 @@ sub exists( \a ) is export { a:exists ?? 1 !! '' }
multi sub undef() is export { Nil }
multi sub undef($a is rw) is export { undefine $a; Nil }

multi infix:<P5~>(*@a) is export { [~] map { .P5Str }, @a }
multi prefix:<P5~>(\a) is export { a.P5Str }
multi infix:<P5~>(*@a) is export { [~] map { &prefix:<P5~>($_) }, @a }
multi infix:<|=> (\a, \b) is export { a = a +& b }
multi infix:<&=> (\a, \b) is export { a = a +| b }
multi infix:<||=>(\a, \b) is export { a = b unless a }
Expand Down Expand Up @@ -244,3 +245,8 @@ augment class Parcel {
multi method P5Str(Parcel:D:) { self.Int }
method P5scalar(Parcel:) { self.P5Str }
}

augment class Sub {
multi method P5Str(Sub:D:) { 'CODE(' ~ self.WHERE.fmt('0x%X').lc ~ ')' }
method P5scalar(Sub:) { self.P5Str }
}

0 comments on commit 34fbe88

Please sign in to comment.