Skip to content

Commit

Permalink
Showing 2 changed files with 24 additions and 6 deletions.
1 change: 0 additions & 1 deletion spec/truffle/tags/language/block_tags.txt

This file was deleted.

Original file line number Diff line number Diff line change
@@ -161,6 +161,22 @@ public RubyNode visitArgsNode(org.jruby.ast.ArgsNode node) {

final RubyNode notNilSmaller = SequenceNode.sequence(context, sourceSection, notNilSmallerSequence);

// The load to use when the there is no rest

final List<RubyNode> noRestSequence = new ArrayList<>();

if (postCount > 0) {
state = State.POST;
org.jruby.ast.Node[] children = node.getPost().children();
index = node.getPreCount() + node.getOptionalArgsCount();
for (int i = 0; i < children.length; i++) {
noRestSequence.add(children[i].accept(this));
index++;
}
}

final RubyNode noRest = SequenceNode.sequence(context, sourceSection, noRestSequence);

// The load to use when the array is not nil and at least as large as the number of required arguments

final List<RubyNode> notNilAtLeastAsLargeSequence = new ArrayList<>();
@@ -179,10 +195,14 @@ public RubyNode visitArgsNode(org.jruby.ast.ArgsNode node) {
final RubyNode notNilAtLeastAsLarge = SequenceNode.sequence(context, sourceSection, notNilAtLeastAsLargeSequence);

if (useArray()) {
sequence.add(new IfNode(context, sourceSection,
new ArrayIsAtLeastAsLargeAsNode(context, sourceSection, loadArray(sourceSection), node.getPreCount() + node.getPostCount()),
notNilAtLeastAsLarge,
notNilSmaller));
if (node.getPreCount() == 0 || node.hasRestArg()) {
sequence.add(new IfNode(context, sourceSection,
new ArrayIsAtLeastAsLargeAsNode(context, sourceSection, loadArray(sourceSection), node.getPreCount() + node.getPostCount()),
notNilAtLeastAsLarge,
notNilSmaller));
} else {
sequence.add(noRest);
}
} else {
// TODO CS 10-Jan-16 needn't have created notNilSmaller
sequence.add(notNilAtLeastAsLarge);
@@ -346,7 +366,6 @@ private RubyNode translateLocalAssignment(ISourcePosition sourcePosition, String
readNode = readArgument(sourceSection);
}
} else {

// Optional argument
final RubyNode defaultValue;

0 comments on commit 58ee260

Please sign in to comment.