Skip to content

Commit

Permalink
Make &infix:<⇒> a first class citizen
Browse files Browse the repository at this point in the history
  • Loading branch information
lizmat committed Aug 20, 2023
1 parent 37aa054 commit 1878651
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/Perl6/Grammar.nqp
Original file line number Diff line number Diff line change
Expand Up @@ -4334,6 +4334,7 @@ grammar Perl6::Grammar is HLL::Grammar does STD {
}
token infix:sym«=>» { <sym> <O(|%item_assignment)> }
token infix:sym<> { <sym> <O(|%item_assignment)> }
token prefix:sym<so> { <sym><.end_prefix> <O(|%loose_unary)> }
token prefix:sym<not> { <sym><.end_prefix> <O(|%loose_unary)> }
Expand Down
3 changes: 3 additions & 0 deletions src/core.c/Pair.pm6
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,9 @@ multi sub infix:<cmp>(Pair:D $a, Pair:D $b) {
proto sub infix=>»(Mu, Mu, *%) is pure {*}
multi sub infix=>»(Mu $key, Mu \value) { Pair.new($key, value) }

# 21D2 RIGHTWARDS DOUBLE ARROW ⇒
my constant &infix:<> := &infix:«=>»;

proto sub pair(Mu, Mu, *%) is pure {*}
multi sub pair(Mu \key, Mu \value) { Pair.new(key, value) }

Expand Down
1 change: 1 addition & 0 deletions t/02-rakudo/03-corekeys-6c.t
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,7 @@ my @expected = (
Q{&infix:«<=»},
Q{&infix:«<»},
Q{&infix:«=>»},
Q{&infix:<⇒>},
Q{&infix:«>=»},
Q{&infix:«>»},
Q{&infix:«~<»},
Expand Down
1 change: 1 addition & 0 deletions t/02-rakudo/03-corekeys-6d.t
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,7 @@ my @expected = (
Q{&infix:«<=»},
Q{&infix:«<»},
Q{&infix:«=>»},
Q{&infix:<⇒>},
Q{&infix:«>=»},
Q{&infix:«>»},
Q{&infix:«~<»},
Expand Down
1 change: 1 addition & 0 deletions t/02-rakudo/03-corekeys-6e.t
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,7 @@ my @expected = (
Q{&infix:«<=»},
Q{&infix:«<»},
Q{&infix:«=>»},
Q{&infix:<⇒>},
Q{&infix:«>=»},
Q{&infix:«>»},
Q{&infix:«~<»},
Expand Down
1 change: 1 addition & 0 deletions t/02-rakudo/03-corekeys.t
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,7 @@ my @allowed =
Q{&infix:«<=»},
Q{&infix:«<»},
Q{&infix:«=>»},
Q{&infix:<⇒>},
Q{&infix:«>=»},
Q{&infix:«>»},
Q{&infix:«~<»},
Expand Down
1 change: 1 addition & 0 deletions t/02-rakudo/04-settingkeys-6c.t
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,7 @@ my %allowed = (
Q{&infix:«<=»},
Q{&infix:«<»},
Q{&infix:«=>»},
Q{&infix:<⇒>},
Q{&infix:«>=»},
Q{&infix:«>»},
Q{&infix:«~<»},
Expand Down
1 change: 1 addition & 0 deletions t/02-rakudo/04-settingkeys-6e.t
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,7 @@ my %allowed = (
Q{&infix:«<=»},
Q{&infix:«<»},
Q{&infix:«=>»},
Q{&infix:<⇒>},
Q{&infix:«>=»},
Q{&infix:«>»},
Q{&infix:«~<»},
Expand Down

0 comments on commit 1878651

Please sign in to comment.