Skip to content

Commit

Permalink
[Truffle] Make it clear what in our Ruby code is just there as a shim.
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisseaton committed Dec 16, 2014
1 parent 20b95a5 commit 233fad8
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 16 deletions.
2 changes: 2 additions & 0 deletions core/src/main/ruby/jruby/truffle/core.rb
Expand Up @@ -18,3 +18,5 @@
require_relative 'core/rubinius/api/common/tuple'
require_relative 'core/rubinius/api/common/type'
require_relative 'core/rubinius/kernel/common/struct'

require_relative 'core/shims'
14 changes: 0 additions & 14 deletions core/src/main/ruby/jruby/truffle/core/kernel.rb
Expand Up @@ -37,18 +37,4 @@ def puts(*args)
end
end

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

def Complex(real, imaginary)
imaginary
end

end

# Here temporarily while we adapt to the newly imported specs

class Channel
end
2 changes: 0 additions & 2 deletions core/src/main/ruby/jruby/truffle/core/main.rb
Expand Up @@ -68,5 +68,3 @@ def self.set_encoding(external, internal)
@internal = internal
end
end

ARGF = Object.new
27 changes: 27 additions & 0 deletions core/src/main/ruby/jruby/truffle/core/shims.rb
@@ -0,0 +1,27 @@
# 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

# These are implemented just to get other stuff working - we'll go back and
# implement these properly later.

module Kernel

def Rational(numerator, denominator)
numerator
end

def Complex(real, imaginary)
imaginary
end

end

class Channel
end

ARGF = Object.new

0 comments on commit 233fad8

Please sign in to comment.