-
-
Notifications
You must be signed in to change notification settings - Fork 922
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Truffle] Pulled in almost all of Rubinius's String.
There are a couple bugs in Rubinius 2.4.1's String implementation that are not fixable via monkey-patching. In these case I removed the lines entirely. Most of those have been fixed upstream and so future upgrades won't conflict anyway. The other cases that would fail do so by failing specs, so we'll be able to just upgrade and see what, if anything, is failing.
- Loading branch information
Showing
17 changed files
with
2,077 additions
and
623 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
fails:String#chomp removes the final carriage return, newline from a multibyte String | ||
fails:String#chomp removes the final carriage return, newline from a non-ASCII String | ||
fails:String#chomp removes the final carriage return, newline from a non-ASCII String when the record separator is changed | ||
fails:String#chomp! removes the final carriage return, newline from a multibyte String | ||
fails:String#chomp! removes the final carriage return, newline from a non-ASCII String | ||
fails:String#chomp! removes the final carriage return, newline from a non-ASCII String when the record separator is changed |
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
Binary file not shown.
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 was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,7 +1,4 @@ | ||
fails:String#partition with String returns an array of substrings based on splitting on the given string | ||
fails:String#partition with String always returns 3 elements | ||
fails:String#partition with String accepts regexp | ||
fails:String#partition with String sets global vars if regexp used | ||
fails:String#partition with String converts its argument using :to_str | ||
fails:String#partition with String raises an error if not convertible to string | ||
fails:String#partition with String takes precedence over a given block |
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 |
---|---|---|
@@ -1,6 +1 @@ | ||
fails:String#rpartition with String returns an array of substrings based on splitting on the given string | ||
fails:String#rpartition with String always returns 3 elements | ||
fails:String#rpartition with String accepts regexp | ||
fails:String#rpartition with String affects $~ | ||
fails:String#rpartition with String converts its argument using :to_str | ||
fails:String#rpartition with String raises an error if not convertible to string |
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 |
---|---|---|
@@ -1,7 +1,2 @@ | ||
fails:String#rstrip returns a copy of self with trailing whitespace removed | ||
fails:String#rstrip returns a copy of self with all trailing whitespace and NULL bytes removed | ||
fails:String#rstrip! modifies self in place and returns self | ||
fails:String#rstrip! modifies self removing trailing NULL bytes and whitespace | ||
fails:String#rstrip! returns nil if no modifications were made | ||
fails:String#rstrip! raises a RuntimeError on a frozen instance that is modified | ||
fails:String#rstrip! raises a RuntimeError on a frozen instance that would not be modified |
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 |
---|---|---|
@@ -1,12 +1,2 @@ | ||
fails:String#scrub with a default replacement returns self for valid strings | ||
fails:String#scrub with a default replacement replaces invalid byte sequences | ||
fails:String#scrub with a custom replacement returns self for valid strings | ||
fails:String#scrub with a custom replacement replaces invalid byte sequences | ||
fails:String#scrub with a custom replacement replaces groups of sequences together with a single replacement | ||
fails:String#scrub with a custom replacement raises ArgumentError for replacements with an invalid encoding | ||
fails:String#scrub with a custom replacement raises TypeError when a non String replacement is given | ||
fails:String#scrub with a block returns self for valid strings | ||
fails:String#scrub with a block replaces invalid byte sequences | ||
fails:String#scrub with a block replaces invalid byte sequences using a custom encoding | ||
fails:String#scrub! modifies self for valid strings | ||
fails:String#scrub! accepts blocks |
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
42 changes: 42 additions & 0 deletions
42
truffle/src/main/java/org/jruby/truffle/nodes/rubinius/UndefinedPrimitiveNodes.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,42 @@ | ||
/* | ||
* Copyright (c) 2015 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.nodes.rubinius; | ||
|
||
import com.oracle.truffle.api.dsl.Specialization; | ||
import com.oracle.truffle.api.source.SourceSection; | ||
import org.jruby.truffle.runtime.RubyContext; | ||
|
||
/** | ||
* Catch-all class for Rubinius primitives that are invoked but haven't yet been defined. Its only purpose is to | ||
* allow Truffle to parse Rubinius primitive calls without failing during the translation phase. If any code ever | ||
* executes nodes here, things will break and you must implement the primitive in its respective parent. | ||
*/ | ||
public abstract class UndefinedPrimitiveNodes { | ||
public final static String NAME = "undefined"; | ||
|
||
|
||
@RubiniusPrimitive(name = NAME) | ||
public static abstract class UndefinedPrimitiveNode extends RubiniusPrimitiveNode { | ||
|
||
public UndefinedPrimitiveNode(RubyContext context, SourceSection sourceSection) { | ||
super(context, sourceSection); | ||
} | ||
|
||
public UndefinedPrimitiveNode(UndefinedPrimitiveNode prev) { | ||
super(prev); | ||
} | ||
|
||
@Specialization | ||
public Object undefined(Object... args) { | ||
throw new UnsupportedOperationException("Undefined Rubinius primitive."); | ||
} | ||
} | ||
|
||
} |
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
Oops, something went wrong.