Skip to content

Commit

Permalink
Revert "Fix smartmatch over topic"
Browse files Browse the repository at this point in the history
This reverts commit f1f757c. It wasn't
supposed to go directly into the branch, just a mistake while working
with git.
  • Loading branch information
vrurg committed Nov 21, 2022
1 parent f1f757c commit ee96a9f
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions src/Raku/ast/expressions.rakumod
Expand Up @@ -233,24 +233,21 @@ class RakuAST::Infix is RakuAST::Infixish is RakuAST::Lookup {

method IMPL-SMARTMATCH-QAST(RakuAST::IMPL::QASTContext $context, Mu $left-qast,
Mu $right-qast, int $negate) {
my $rhs-local := QAST::Node.unique('sm-rhs');
my $accepts-call := QAST::Op.new(
:op('callmethod'), :name('ACCEPTS'),
QAST::Var.new(:name($rhs-local), :scope<local>),
QAST::Var.new( :name('$_'), :scope('lexical') ));
$right-qast,
QAST::Var.new( :name('$_'), :scope('lexical') )
);
if $negate {
$accepts-call := QAST::Op.new(
:op('hllbool'),
QAST::Op.new(
:op('not_i'),
QAST::Op.new( :op('istrue'), $accepts-call )));
QAST::Op.new( :op('istrue'), $accepts-call )
)
);
}
QAST::Stmts.new(
QAST::Op.new(
:op('bind'),
QAST::Var.new(:name($rhs-local), :scope<local>, :decl<var>),
$right-qast ),
self.IMPL-TEMPORARIZE-TOPIC($left-qast, $accepts-call))
self.IMPL-TEMPORARIZE-TOPIC($left-qast, $accepts-call)
}

method IMPL-LIST-INFIX-QAST(RakuAST::IMPL::QASTContext $context, Mu $operands) {
Expand Down

0 comments on commit ee96a9f

Please sign in to comment.