Skip to content

Commit

Permalink
Add OperatorProperties.associative-reversed method
Browse files Browse the repository at this point in the history
To be used when handling the R meta-operator
  • Loading branch information
lizmat committed Sep 6, 2023
1 parent b245dcb commit 24c05ee
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/Raku/ast/operator-properties.rakumod
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,17 @@ class OperatorProperties {
)
}

# An OperatorProperties object with associative reversed
method associative-reversed() {
nqp::isconcrete(self)
?? $!associative eq 'left'
?? self.new(:associative<right>, :dba("reversed " ~ $!dba))
!! $!associative eq 'right'
?? self.new(:associative<left>, :dba("reversed " ~ $!dba))
!! self
!! self
}

# A readable .raku representation for debugging
method raku() {
my str $name := self.HOW.name(self);
Expand Down

0 comments on commit 24c05ee

Please sign in to comment.