-
-
Notifications
You must be signed in to change notification settings - Fork 925
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into truffle-head
- 9.4.12.0
- 9.4.11.0
- 9.4.10.0
- 9.4.9.0
- 9.4.8.0
- 9.4.7.0
- 9.4.6.0
- 9.4.5.0
- 9.4.4.0
- 9.4.3.0
- 9.4.2.0
- 9.4.1.0
- 9.4.0.0
- 9.3.15.0
- 9.3.14.0
- 9.3.13.0
- 9.3.12.0
- 9.3.11.0
- 9.3.10.0
- 9.3.9.0
- 9.3.8.0
- 9.3.7.0
- 9.3.6.0
- 9.3.5.0
- 9.3.4.0
- 9.3.3.0
- 9.3.2.0
- 9.3.1.0
- 9.3.0.0
- 9.2.21.0
- 9.2.20.1
- 9.2.20.0
- 9.2.19.0
- 9.2.18.0
- 9.2.17.0
- 9.2.16.0
- 9.2.15.0
- 9.2.14.0
- 9.2.13.0
- 9.2.12.0
- 9.2.11.1
- 9.2.11.0
- 9.2.10.0
- 9.2.9.0
- 9.2.8.0
- 9.2.7.0
- 9.2.6.0
- 9.2.5.0
- 9.2.4.1
- 9.2.4.0
- 9.2.3.0
- 9.2.2.0
- 9.2.1.0
- 9.2.0.0
- 9.1.17.0
- 9.1.16.0
- 9.1.15.0
- 9.1.14.0
- 9.1.13.0
- 9.1.12.0
- 9.1.11.0
- 9.1.10.0
- 9.1.9.0
- 9.1.8.0
- 9.1.7.0
- 9.1.6.0
- 9.1.5.0
- 9.1.4.0
- 9.1.3.0
- 9.1.2.0
- 9.1.1.0
Showing
32 changed files
with
788 additions
and
417 deletions.
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Copyright (c) 2016 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 | ||
|
||
require_relative '../../../../ruby/spec_helper' | ||
|
||
describe "Truffle::Interop.boxed?" do | ||
|
||
it "returns false for empty strings" do | ||
Truffle::Interop.boxed?('').should be_false | ||
end | ||
|
||
it "returns true for strings with one byte" do | ||
Truffle::Interop.boxed?('1').should be_true | ||
end | ||
|
||
it "returns false for strings with two bytes" do | ||
Truffle::Interop.boxed?('12').should be_false | ||
end | ||
|
||
end |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Copyright (c) 2016 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 | ||
|
||
require_relative '../../../../ruby/spec_helper' | ||
|
||
describe "Truffle::Interop.executable?" do | ||
|
||
def test_method | ||
end | ||
|
||
it "returns true for methods" do | ||
Truffle::Interop.executable?(method(:test_method)).should be_true | ||
end | ||
|
||
it "returns true for procs" do | ||
Truffle::Interop.executable?(proc { }).should be_true | ||
end | ||
|
||
it "returns true for lambdas" do | ||
Truffle::Interop.executable?(lambda { }).should be_true | ||
end | ||
|
||
it "returns false for nil" do | ||
Truffle::Interop.executable?(nil).should be_false | ||
end | ||
|
||
it "returns false for strings" do | ||
Truffle::Interop.executable?('hello').should be_false | ||
end | ||
|
||
end |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Copyright (c) 2016 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 | ||
|
||
require_relative '../../../../ruby/spec_helper' | ||
|
||
describe "Truffle::Interop.execute" do | ||
|
||
def add(a, b) | ||
a + b | ||
end | ||
|
||
it "calls methods" do | ||
Truffle::Interop.execute(method(:add), 14, 2).should == 16 | ||
end | ||
|
||
it "calls procs" do | ||
Truffle::Interop.execute(proc { |a, b| a + b }, 14, 2).should == 16 | ||
end | ||
|
||
it "calls lambdas" do | ||
Truffle::Interop.execute(lambda { |a, b| a + b }, 14, 2).should == 16 | ||
end | ||
|
||
it "doesn't call nil" do | ||
lambda { Truffle::Interop.execute(nil) }.should raise_error(RubyTruffleError) | ||
end | ||
|
||
it "doesn't call strings" do | ||
lambda { Truffle::Interop.execute('hello') }.should raise_error(RubyTruffleError) | ||
end | ||
|
||
end |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Copyright (c) 2016 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 | ||
|
||
require_relative '../../../../ruby/spec_helper' | ||
|
||
describe "Truffle::Interop.invoke" do | ||
|
||
class InvokeTestClass | ||
|
||
def add(a, b) | ||
a + b | ||
end | ||
|
||
end | ||
|
||
it "invokes methods using symbols" do | ||
Truffle::Interop.invoke(InvokeTestClass.new, :add, 14, 2).should == 16 | ||
end | ||
|
||
it "invokes methods using strings" do | ||
Truffle::Interop.invoke(InvokeTestClass.new, 'add', 14, 2).should == 16 | ||
end | ||
|
||
end |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Copyright (c) 2016 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 | ||
|
||
require_relative '../../../../ruby/spec_helper' | ||
|
||
describe "Truffle::Interop.null?" do | ||
|
||
it "returns true for nil" do | ||
Truffle::Interop.null?(nil).should be_true | ||
end | ||
|
||
it "returns false for strings" do | ||
Truffle::Interop.null?('').should be_false | ||
end | ||
|
||
it "returns false for zero" do | ||
Truffle::Interop.null?(0).should be_false | ||
end | ||
|
||
it "returns false for false" do | ||
Truffle::Interop.null?(false).should be_false | ||
end | ||
|
||
end |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
# Copyright (c) 2016 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 | ||
|
||
require_relative '../../../../ruby/spec_helper' | ||
|
||
describe "Truffle::Interop.read" do | ||
|
||
class ReadInstanceVariable | ||
|
||
def initialize | ||
@foo = 14 | ||
end | ||
|
||
end | ||
|
||
class HasMethod | ||
|
||
def foo | ||
14 | ||
end | ||
|
||
end | ||
|
||
class HasIndex | ||
|
||
def [](n) | ||
14 | ||
end | ||
|
||
end | ||
|
||
it "reads a byte from a string" do | ||
Truffle::Interop.read('123', 1).should == '2'.ord | ||
end | ||
|
||
describe "reads an instance variable if given an @name" do | ||
it "as a symbol" do | ||
Truffle::Interop.read(ReadInstanceVariable.new, :@foo).should == 14 | ||
end | ||
|
||
it "as a string" do | ||
Truffle::Interop.read(ReadInstanceVariable.new, '@foo').should == 14 | ||
end | ||
end | ||
|
||
describe "calls #[] if there isn't a method with the same name" do | ||
it "as a symbol" do | ||
Truffle::Interop.read(HasIndex.new, :foo).should == 14 | ||
end | ||
|
||
it "as a string" do | ||
Truffle::Interop.read(HasIndex.new, 'foo').should == 14 | ||
end | ||
end | ||
|
||
describe "calls a method if there is a method with the same name" do | ||
it "as a symbol" do | ||
Truffle::Interop.read(HasMethod.new, :foo).should == 14 | ||
end | ||
|
||
it "as a string" do | ||
Truffle::Interop.read(HasMethod.new, 'foo').should == 14 | ||
end | ||
end | ||
|
||
it "can be used to index an array" do | ||
Truffle::Interop.read([1, 2, 3], 1).should == 2 | ||
end | ||
|
||
it "can be used to index a hash" do | ||
Truffle::Interop.read({1 => 2, 3 => 4, 5 => 6}, 3).should == 4 | ||
end | ||
|
||
end |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Copyright (c) 2016 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 | ||
|
||
require_relative '../../../../ruby/spec_helper' | ||
|
||
describe "Truffle::Interop.size" do | ||
|
||
class InteropSizeClass | ||
|
||
def size | ||
14 | ||
end | ||
|
||
end | ||
|
||
it "returns the size of an array" do | ||
Truffle::Interop.size([1, 2, 3]).should == 3 | ||
end | ||
|
||
it "returns the size of an array" do | ||
Truffle::Interop.size({a: 1, b: 2, c: 3}).should == 3 | ||
end | ||
|
||
it "returns the size of an string" do | ||
Truffle::Interop.size('123').should == 3 | ||
end | ||
|
||
it "returns the size of any object with a size method" do | ||
Truffle::Interop.size(InteropSizeClass.new).should == 14 | ||
end | ||
|
||
end |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Copyright (c) 2016 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 | ||
|
||
require_relative '../../../../ruby/spec_helper' | ||
|
||
describe "Truffle::Interop.size?" do | ||
|
||
it "returns true for arrays" do | ||
Truffle::Interop.size?([]).should be_true | ||
end | ||
|
||
it "returns true for hashes" do | ||
Truffle::Interop.size?({}).should be_true | ||
end | ||
|
||
it "returns true for strings" do | ||
Truffle::Interop.size?('').should be_true | ||
end | ||
|
||
it "returns false for nil" do | ||
Truffle::Interop.size?(nil).should be_false | ||
end | ||
|
||
end |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# Copyright (c) 2016 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 | ||
|
||
require_relative '../../../../ruby/spec_helper' | ||
|
||
describe "Truffle::Interop.unbox" do | ||
|
||
it "passes through fixnums" do | ||
Truffle::Interop.unbox(14).should == 14 | ||
end | ||
|
||
it "passes through floats" do | ||
Truffle::Interop.unbox(14.2).should == 14.2 | ||
end | ||
|
||
it "passes through true" do | ||
Truffle::Interop.unbox(true).should == true | ||
end | ||
|
||
it "passes through false" do | ||
Truffle::Interop.unbox(false).should == false | ||
end | ||
|
||
it "doesn't work on empty strings" do | ||
lambda { Truffle::Interop.unbox('') }.should raise_error(RubyTruffleError) | ||
end | ||
|
||
it "returns the first byte on strings with one byte" do | ||
Truffle::Interop.unbox('1').should == '1'.ord | ||
end | ||
|
||
it "returns the first byte on strings with two bytes" do | ||
Truffle::Interop.unbox('1').should == '1'.ord | ||
end | ||
|
||
it "returns nil for nil" do | ||
Truffle::Interop.unbox(nil).should be_nil | ||
end | ||
|
||
end |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
# Copyright (c) 2016 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 | ||
|
||
require_relative '../../../../ruby/spec_helper' | ||
|
||
describe "Truffle::Interop.write" do | ||
|
||
class HasMethod | ||
|
||
def foo=(value) | ||
@called = true | ||
end | ||
|
||
def called? | ||
@called | ||
end | ||
|
||
end | ||
|
||
class HasIndexSet | ||
|
||
def []=(n, value) | ||
@called = true | ||
end | ||
|
||
def called? | ||
@called | ||
end | ||
|
||
end | ||
|
||
describe "writes an instance variable if given an @name" do | ||
it "as a symbol" do | ||
object = Object.new | ||
Truffle::Interop.write object, :@foo, 14 | ||
object.instance_variable_get(:@foo).should == 14 | ||
end | ||
|
||
it "as a string" do | ||
object = Object.new | ||
Truffle::Interop.write object, '@foo', 14 | ||
object.instance_variable_get(:@foo).should == 14 | ||
end | ||
end | ||
|
||
describe "calls #[]= if there isn't a method with the same name" do | ||
it "as a symbol" do | ||
object = HasIndexSet.new | ||
Truffle::Interop.write object, :foo, 14 | ||
object.called?.should be_true | ||
end | ||
|
||
it "as a string" do | ||
object = HasIndexSet.new | ||
Truffle::Interop.write object, 'foo', 14 | ||
object.called?.should be_true | ||
end | ||
end | ||
|
||
describe "calls a method if there is a method with the same name plus =" do | ||
it "as a symbol" do | ||
object = HasMethod.new | ||
Truffle::Interop.write object, :foo, 14 | ||
object.called?.should be_true | ||
end | ||
|
||
it "as a string" do | ||
object = HasMethod.new | ||
Truffle::Interop.write object, 'foo', 14 | ||
object.called?.should be_true | ||
end | ||
end | ||
|
||
it "can be used to assign an array" do | ||
array = [1, 2, 3] | ||
Truffle::Interop.write array, 1, 14 | ||
array[1].should == 14 | ||
end | ||
|
||
it "can be used to assign a hash" do | ||
hash = {1 => 2, 3 => 4, 5 => 6} | ||
Truffle::Interop.write hash, 3, 14 | ||
hash[3].should == 14 | ||
end | ||
|
||
end |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
fails:Module#define_method when name is not a special private name given an UnboundMethod and called from another module sets the visibility of the method to public | ||
fails:Module#define_method when name is not a special private name passed a block and called from another module sets the visibility of the method to public |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Copyright (c) 2016 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 | ||
|
||
module InteropPE | ||
class A | ||
attr_accessor :foo | ||
def initialize(value) | ||
@foo = value | ||
end | ||
end | ||
end | ||
|
||
|
||
example "Truffle::Interop.read(InteropPE::A.new(42), :@foo)", 42 | ||
example "Truffle::Interop.read(InteropPE::A.new(42), '@foo')", 42 |
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
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
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
46 changes: 46 additions & 0 deletions
46
truffle/src/main/java/org/jruby/truffle/interop/IsStringLikeNode.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/* | ||
* Copyright (c) 2016 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.interop; | ||
|
||
import com.oracle.truffle.api.dsl.NodeChild; | ||
import com.oracle.truffle.api.dsl.Specialization; | ||
import com.oracle.truffle.api.object.DynamicObject; | ||
import org.jruby.truffle.language.RubyNode; | ||
|
||
@NodeChild(value = "value", type = RubyNode.class) | ||
public abstract class IsStringLikeNode extends RubyNode { | ||
|
||
public static IsStringLikeNode create() { | ||
return IsStringLikeNodeGen.create(null); | ||
} | ||
|
||
public abstract boolean executeIsStringLike(Object value); | ||
|
||
@Specialization(guards = "isRubyString(value)") | ||
boolean isRubyString(DynamicObject value) { | ||
return true; | ||
} | ||
|
||
@Specialization(guards = "isRubySymbol(value)") | ||
public boolean isRubySymbol(DynamicObject value) { | ||
return true; | ||
} | ||
|
||
@Specialization | ||
public boolean isJavaString(String value) { | ||
return true; | ||
} | ||
|
||
@Specialization(guards = { "!isRubyString(value)", "!isRubySymbol(value)", "!isString(value)" }) | ||
public boolean notStringLike(Object value) { | ||
return false; | ||
} | ||
|
||
} |
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
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