Skip to content

Commit 4b5424c

Browse files
committed
Minor changes to variable and method names in LoadArgumentsTranslator.
1 parent 5ac6497 commit 4b5424c

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/main/java/org/truffleruby/parser/LoadArgumentsTranslator.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public int getPreviousIndex() {
8686
}
8787

8888
private final boolean isProc;
89-
private final boolean hasMethodBlock;
89+
private final boolean isMethod;
9090
private final BodyTranslator methodBodyTranslator;
9191
private final Deque<ArraySlot> arraySlotStack = new ArrayDeque<>();
9292

@@ -108,7 +108,7 @@ private enum State {
108108
public LoadArgumentsTranslator(Node currentNode, ArgsParseNode argsNode, RubyContext context, Source source, ParserContext parserContext, boolean isProc, boolean hasMethodBlock, BodyTranslator methodBodyTranslator) {
109109
super(currentNode, context, source, parserContext);
110110
this.isProc = isProc;
111-
this.hasMethodBlock = hasMethodBlock;
111+
this.isMethod = hasMethodBlock;
112112
this.methodBodyTranslator = methodBodyTranslator;
113113
this.argsNode = argsNode;
114114
this.required = argsNode.getRequiredCount();
@@ -159,8 +159,8 @@ public RubyNode translate() {
159159

160160
// Do this before handling optional arguments as one might get
161161
// its default value via a `yield`.
162-
if (hasMethodBlock) {
163-
sequence.add(visitMethodBlockArg());
162+
if (isMethod) {
163+
sequence.add(saveMethodBlockArg());
164164
}
165165

166166
final int optArgCount = argsNode.getOptionalArgsCount();
@@ -342,7 +342,7 @@ public RubyNode visitRestArgNode(RestArgParseNode node) {
342342
return new WriteLocalVariableNode(slot, readNode);
343343
}
344344

345-
public RubyNode visitMethodBlockArg() {
345+
public RubyNode saveMethodBlockArg() {
346346
final RubyNode readNode = new ReadBlockNode(context.getCoreLibrary().getNil());
347347
final FrameSlot slot = methodBodyTranslator.getEnvironment().getFrameDescriptor().findOrAddFrameSlot(TranslatorEnvironment.METHOD_BLOCK_NAME);
348348
return new WriteLocalVariableNode(slot, readNode);

0 commit comments

Comments
 (0)