Skip to content
Permalink
Browse files
[Truffle] Implement just enough of Rational and Complex for language …
…specs.
  • Loading branch information
eregon committed Dec 3, 2014
1 parent 5ea7533 commit f66d751a35e8dda462489a6d402114b2e42d1c40
@@ -658,6 +658,14 @@ private RubyNode translateCPath(SourceSection sourceSection, org.jruby.ast.Colon
}
}

@Override
public RubyNode visitComplexNode(ComplexNode node) {
final SourceSection sourceSection = translate(node.getPosition());

// TODO: implement Complex
return node.getNumber().accept(this);
}

@Override
public RubyNode visitConstDeclNode(org.jruby.ast.ConstDeclNode node) {
final SourceSection sourceSection = translate(node.getPosition());
@@ -1834,6 +1842,14 @@ public RubyNode visitPostExeNode(PostExeNode node) {
return node.getBodyNode().accept(this);
}

@Override
public RubyNode visitRationalNode(RationalNode node) {
final SourceSection sourceSection = translate(node.getPosition());

// TODO: implement Rational
return new FixnumLiteralNode.LongFixnumLiteralNode(context, sourceSection, node.getNumerator());
}

@Override
public RubyNode visitRedoNode(org.jruby.ast.RedoNode node) {
return new RedoNode(context, translate(node.getPosition()));
@@ -33,6 +33,15 @@ def puts(*args)
end
end

# Minimal support for language specs
def Rational(numerator, denominator)
numerator
end

def Complex(real, imaginary)
imaginary
end

end

def STDOUT.internal_encoding

This file was deleted.

0 comments on commit f66d751

Please sign in to comment.