Skip to content

Commit

Permalink
🦄 refactor: Redesign ast 45
Browse files Browse the repository at this point in the history
  • Loading branch information
caoccao committed Dec 9, 2024
1 parent 75d0e88 commit 55b35f9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,13 @@ public Ts2JavaAstBinExprLogical setLabelFalse(Label labelFalse) {
return this;
}

public Ts2JavaAstBinExprLogical setLabelTrue(Label labelTrue) {
this.labelTrue = labelTrue;
public Ts2JavaAstBinExprLogical setLabelSwitched(boolean labelSwitched) {
this.labelSwitched = labelSwitched;
return this;
}

public Ts2JavaAstBinExprLogical switchLabel() {
labelSwitched = !labelSwitched;
public Ts2JavaAstBinExprLogical setLabelTrue(Label labelTrue) {
this.labelTrue = labelTrue;
return this;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public Size apply(MethodVisitor methodVisitor, Implementation.Context context) {
}
case LogicalOr: {
if (isLeftLogical) {
left.as(Ts2JavaAstBinExprLogical.class).switchLabel();
left.as(Ts2JavaAstBinExprLogical.class).setLabelSwitched(true);
}
final int opcodeCompareTrue = bangFlipped ? Opcodes.IFEQ : Opcodes.IFNE;
sizes.add(left.apply(methodVisitor, context));
Expand Down

0 comments on commit 55b35f9

Please sign in to comment.