Skip to content

Commit

Permalink
Showing 2 changed files with 3 additions and 24 deletions.
Original file line number Diff line number Diff line change
@@ -1887,7 +1887,7 @@ public RubyNode visitMultipleAsgnNode(MultipleAsgnNode node) {
RubyNode rhsTranslated;

if (rhs == null) {
context.getRuntime().getWarnings().warn(IRubyWarnings.ID.TRUFFLE, node.getPosition().getFile(), node.getPosition().getLine(), "no RHS for multiple assignment - using nil");
context.getRuntime().getWarnings().warn(IRubyWarnings.ID.TRUFFLE, source.getName(), node.getPosition().getLine(), "no RHS for multiple assignment - using nil");
rhsTranslated = new DefinedWrapperNode(context, sourceSection,
new LiteralNode(context, sourceSection, context.getCoreLibrary().getNilObject()),
"nil");
@@ -2124,7 +2124,7 @@ public RubyNode visitMultipleAsgnNode(MultipleAsgnNode node) {

result = SequenceNode.sequence(context, sourceSection, sequence);
} else {
context.getRuntime().getWarnings().warn(IRubyWarnings.ID.TRUFFLE, node.getPosition().getFile(), node.getPosition().getLine(), node + " unknown form of multiple assignment");
context.getRuntime().getWarnings().warn(IRubyWarnings.ID.TRUFFLE, source.getName(), node.getPosition().getLine(), node + " unknown form of multiple assignment");
result = new DefinedWrapperNode(context, sourceSection,
new LiteralNode(context, sourceSection, context.getCoreLibrary().getNilObject()),
"nil");
@@ -2878,7 +2878,7 @@ protected RubyNode defaultVisit(Node node) {
}

protected RubyNode unimplemented(Node node) {
context.getRuntime().getWarnings().warn(IRubyWarnings.ID.TRUFFLE, node.getPosition().getFile(), node.getPosition().getLine(), node + " does nothing - translating as nil");
context.getRuntime().getWarnings().warn(IRubyWarnings.ID.TRUFFLE, source.getName(), node.getPosition().getLine(), node + " does nothing - translating as nil");
SourceSection sourceSection = translate(node.getPosition());
return new DefinedWrapperNode(context, sourceSection,
new LiteralNode(context, sourceSection, context.getCoreLibrary().getNilObject()),
Original file line number Diff line number Diff line change
@@ -39,7 +39,6 @@
import org.jruby.truffle.runtime.methods.InternalMethod;
import org.jruby.truffle.runtime.methods.SharedMethodInfo;

import java.io.IOException;
import java.nio.charset.StandardCharsets;

public class TranslatorDriver {
@@ -54,26 +53,6 @@ public TranslatorDriver(RubyContext context) {
parseEnvironment = new ParseEnvironment(context);
}

public RubyNode parse(RubyContext context, org.jruby.ast.Node parseTree, org.jruby.ast.ArgsNode argsNode, org.jruby.ast.Node bodyNode, Node currentNode) {
final LexicalScope lexicalScope = context.getRootLexicalScope(); // TODO(eregon): figure out how to get the lexical scope from JRuby
final SharedMethodInfo sharedMethod = new SharedMethodInfo(null, lexicalScope, Arity.NO_ARGUMENTS, "(unknown)", false, parseTree, false);

final TranslatorEnvironment environment = new TranslatorEnvironment(
context, environmentForFrame(context, null), parseEnvironment, parseEnvironment.allocateReturnID(), true, true, sharedMethod, sharedMethod.getName(), false, null);

// Translate to Ruby Truffle nodes

final MethodTranslator translator;

try {
translator = new MethodTranslator(currentNode, context, null, environment, false, Source.fromFileName(bodyNode.getPosition().getFile()), argsNode);
} catch (IOException e) {
throw new RuntimeException(e);
}

return translator.compileFunctionNode(null, "(unknown)", bodyNode, sharedMethod);
}

public RubyRootNode parse(RubyContext context, Source source, Encoding defaultEncoding, ParserContext parserContext, MaterializedFrame parentFrame, boolean ownScopeForAssignments, Node currentNode, NodeWrapper wrapper) {
// Set up the JRuby parser

0 comments on commit cbc1511

Please sign in to comment.