com.llamalad7.mixinextras.expression.impl.ast.expressions.BoundMethodReferenceExpression Maven / Gradle / Ivy
package com.llamalad7.mixinextras.expression.impl.ast.expressions;
import com.llamalad7.mixinextras.expression.impl.ExpressionSource;
import com.llamalad7.mixinextras.expression.impl.ast.identifiers.MemberIdentifier;
import com.llamalad7.mixinextras.expression.impl.flow.FlowValue;
import com.llamalad7.mixinextras.expression.impl.flow.postprocessing.LMFInfo;
import com.llamalad7.mixinextras.expression.impl.point.ExpressionContext;
import com.llamalad7.mixinextras.expression.impl.utils.FlowDecorations;
public class BoundMethodReferenceExpression extends SimpleExpression {
public final Expression receiver;
public final MemberIdentifier name;
public BoundMethodReferenceExpression(ExpressionSource src, Expression receiver, MemberIdentifier name) {
super(src);
this.receiver = receiver;
this.name = name;
}
@Override
public boolean matches(FlowValue node, ExpressionContext ctx) {
LMFInfo info = node.getDecoration(FlowDecorations.LMF_INFO);
if (info == null || info.type != LMFInfo.Type.BOUND_METHOD) {
return false;
}
return name.matches(ctx.pool, node) && receiver.matches(node.getInput(0), ctx);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy