Skip to content

Commit

Permalink
Move infix:<~> to the core setting; also remove the :pirop mention fr…
Browse files Browse the repository at this point in the history
…om the grammar (we never actually used the PIR version of the op).
  • Loading branch information
jnthn committed Feb 6, 2010
1 parent 7ff29e3 commit 273ce82
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/Perl6/Grammar.pm
Expand Up @@ -1034,7 +1034,7 @@ token infix:sym<?^> { <sym> <O('%additive')> }
token infix:sym<x> { <sym> <O('%replication')> }
token infix:sym<xx> { <sym> <O('%replication')> }

token infix:sym<~> { <sym> <O('%concatenation , :pirop<concat>')> }
token infix:sym<~> { <sym> <O('%concatenation')> }

token infix:sym<&> { <sym> <O('%junctive_and')> }
token infix:sym<|> { <sym> <O('%junctive_or')> }
Expand Down
9 changes: 0 additions & 9 deletions src/cheats/str-ops.pir
Expand Up @@ -5,15 +5,6 @@
.return ($P0)
.end

.sub '&infix:<~>'
.param string a
.param string b
$S0 = concat a, b
$P0 = new ['Str']
assign $P0, $S0
.return ($P0)
.end

.sub '&infix:<~|>'
.param string a
.param string b
Expand Down
6 changes: 6 additions & 0 deletions src/core/operators.pm
Expand Up @@ -126,3 +126,9 @@ our multi infix:<max>(*@args) {
our multi infix=>»($key, $value) {
Pair.new(key => $key, value => $value);
}

our multi infix:<~>($a, $b) {
my $result = pir::new__Ps('Str');
pir::assign__vPS($result, pir::concat__SSS(~$a, ~$b));
$result
}

0 comments on commit 273ce82

Please sign in to comment.