Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
[Truffle] Starting to fix attribute assignment returning the RHS rath…
…er than the result of the method.
- Loading branch information
Showing
with
131 additions
and 3 deletions.
- +5 −0 core/src/main/java/org/jruby/ast/visitor/AbstractNodeVisitor.java
- +1 −0 core/src/main/java/org/jruby/ast/visitor/NodeVisitor.java
- +69 −3 core/src/main/java/org/jruby/truffle/translator/BodyTranslator.java
- +53 −0 core/src/main/java/org/jruby/truffle/translator/ReadLocalDummyNode.java
- +2 −0 spec/truffle/tags/language/array_tags.txt
- +1 −0 spec/truffle/tags/language/send_tags.txt
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -583,4 +583,9 @@ public T visitZSuperNode(ZSuperNode node) { | ||
return defaultVisit(node); | ||
} | ||
|
||
@Override | ||
public T visitOther(Node node) { | ||
return defaultVisit(node); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -146,4 +146,5 @@ | ||
public T visitYieldNode(YieldNode iVisited); | ||
public T visitZArrayNode(ZArrayNode iVisited); | ||
public T visitZSuperNode(ZSuperNode iVisited); | ||
public T visitOther(Node iVisited); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -0,0 +1,53 @@ | ||
/* | ||
* Copyright (c) 2014 Oracle and/or its affiliates. All rights reserved. This | ||
* code is released under a tri EPL/GPL/LGPL license. You can use it, | ||
* redistribute it and/or modify it under the terms of the: | ||
* | ||
* Eclipse Public License version 1.0 | ||
* GNU General Public License version 2 | ||
* GNU Lesser General Public License version 2.1 | ||
*/ | ||
package org.jruby.truffle.translator; | ||
|
||
import com.oracle.truffle.api.frame.FrameSlot; | ||
import com.oracle.truffle.api.source.SourceSection; | ||
import org.jruby.ast.Node; | ||
import org.jruby.ast.NodeType; | ||
import org.jruby.ast.visitor.NodeVisitor; | ||
|
||
import java.util.List; | ||
|
||
public class ReadLocalDummyNode extends org.jruby.ast.Node { | ||
|
||
final SourceSection sourceSection; | ||
final FrameSlot frameSlot; | ||
|
||
public ReadLocalDummyNode(SourceSection sourceSection, FrameSlot frameSlot) { | ||
super(null); | ||
this.sourceSection = sourceSection; | ||
this.frameSlot = frameSlot; | ||
} | ||
|
||
@Override | ||
public <T> T accept(NodeVisitor<T> visitor) { | ||
return visitor.visitOther(this); | ||
} | ||
|
||
@Override | ||
public List<Node> childNodes() { | ||
throw new UnsupportedOperationException(); | ||
} | ||
|
||
@Override | ||
public NodeType getNodeType() { | ||
throw new UnsupportedOperationException(); | ||
} | ||
|
||
public SourceSection getSourceSection() { | ||
return sourceSection; | ||
} | ||
|
||
public FrameSlot getFrameSlot() { | ||
return frameSlot; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -0,0 +1,2 @@ | ||
fails:The unpacking splat operator (*) unpacks arguments as if they were listed statically | ||
fails:The unpacking splat operator (*) unpacks the start and count arguments in an array slice assignment |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters