Skip to content

Commit

Permalink
[Truffle] Add json to stdlib.
Browse files Browse the repository at this point in the history
  • Loading branch information
bjfish committed Apr 28, 2015
1 parent 5968ffa commit e75cd2d
Show file tree
Hide file tree
Showing 28 changed files with 38 additions and 8 deletions.
1 change: 1 addition & 0 deletions lib/ruby/truffle/mri/json.rb
@@ -0,0 +1 @@
require_relative '../../stdlib/json'
1 change: 1 addition & 0 deletions lib/ruby/truffle/mri/json/add/bigdecimal.rb
@@ -0,0 +1 @@
require_relative '../../../../stdlib/json/add/' + File.basename(__FILE__)

This comment has been minimized.

Copy link
@chrisseaton

chrisseaton Apr 28, 2015

Contributor

This is a nifty trick. Do you have a little script to do this? Perhaps you could commit that to tools and use it for the rest of our stdlib that just redirects.

This comment has been minimized.

Copy link
@nirvdrum

nirvdrum Apr 28, 2015

Contributor

We're doing it elsewhere as well (see: optparse). It makes copy & pasting a lot easier. But adding something that automates the process to jt would be fantastic. jt unmask stdlib/json or something.

This comment has been minimized.

Copy link
@bjfish

bjfish Apr 28, 2015

Author Contributor

I think @nirvdrum did this nifty trick first. I don't have any scripts or tool to add these.

1 change: 1 addition & 0 deletions lib/ruby/truffle/mri/json/add/complex.rb
@@ -0,0 +1 @@
require_relative '../../../../stdlib/json/add/' + File.basename(__FILE__)
1 change: 1 addition & 0 deletions lib/ruby/truffle/mri/json/add/core.rb
@@ -0,0 +1 @@
require_relative '../../../../stdlib/json/add/' + File.basename(__FILE__)
1 change: 1 addition & 0 deletions lib/ruby/truffle/mri/json/add/date.rb
@@ -0,0 +1 @@
require_relative '../../../../stdlib/json/add/' + File.basename(__FILE__)
1 change: 1 addition & 0 deletions lib/ruby/truffle/mri/json/add/date_time.rb
@@ -0,0 +1 @@
require_relative '../../../../stdlib/json/add/' + File.basename(__FILE__)
1 change: 1 addition & 0 deletions lib/ruby/truffle/mri/json/add/exception.rb
@@ -0,0 +1 @@
require_relative '../../../../stdlib/json/add/' + File.basename(__FILE__)
1 change: 1 addition & 0 deletions lib/ruby/truffle/mri/json/add/ostruct.rb
@@ -0,0 +1 @@
require_relative '../../../../stdlib/json/add/' + File.basename(__FILE__)
1 change: 1 addition & 0 deletions lib/ruby/truffle/mri/json/add/range.rb
@@ -0,0 +1 @@
require_relative '../../../../stdlib/json/add/' + File.basename(__FILE__)
1 change: 1 addition & 0 deletions lib/ruby/truffle/mri/json/add/rational.rb
@@ -0,0 +1 @@
require_relative '../../../../stdlib/json/add/' + File.basename(__FILE__)
1 change: 1 addition & 0 deletions lib/ruby/truffle/mri/json/add/regexp.rb
@@ -0,0 +1 @@
require_relative '../../../../stdlib/json/add/' + File.basename(__FILE__)
1 change: 1 addition & 0 deletions lib/ruby/truffle/mri/json/add/struct.rb
@@ -0,0 +1 @@
require_relative '../../../../stdlib/json/add/' + File.basename(__FILE__)
1 change: 1 addition & 0 deletions lib/ruby/truffle/mri/json/add/symbol.rb
@@ -0,0 +1 @@
require_relative '../../../../stdlib/json/add/' + File.basename(__FILE__)
1 change: 1 addition & 0 deletions lib/ruby/truffle/mri/json/add/time.rb
@@ -0,0 +1 @@
require_relative '../../../../stdlib/json/add/' + File.basename(__FILE__)
1 change: 1 addition & 0 deletions lib/ruby/truffle/mri/json/common.rb
@@ -0,0 +1 @@
require_relative '../../../stdlib/json/' + File.basename(__FILE__)
1 change: 1 addition & 0 deletions lib/ruby/truffle/mri/json/ext.rb
@@ -0,0 +1 @@
require_relative '../../../stdlib/json/' + File.basename(__FILE__)
1 change: 1 addition & 0 deletions lib/ruby/truffle/mri/json/generic_object.rb
@@ -0,0 +1 @@
require_relative '../../../stdlib/json/' + File.basename(__FILE__)
1 change: 1 addition & 0 deletions lib/ruby/truffle/mri/json/pure.rb
@@ -0,0 +1 @@
require_relative '../../../stdlib/json/' + File.basename(__FILE__)
1 change: 1 addition & 0 deletions lib/ruby/truffle/mri/json/pure/generator.rb
@@ -0,0 +1 @@
require_relative '../../../../stdlib/json/pure/' + File.basename(__FILE__)
1 change: 1 addition & 0 deletions lib/ruby/truffle/mri/json/pure/parser.rb
@@ -0,0 +1 @@
require_relative '../../../../stdlib/json/pure/' + File.basename(__FILE__)
1 change: 1 addition & 0 deletions lib/ruby/truffle/mri/json/version.rb
@@ -0,0 +1 @@
require_relative '../../../stdlib/json/' + File.basename(__FILE__)
3 changes: 3 additions & 0 deletions test/mri/excludes_truffle/TestJSON.rb
@@ -0,0 +1,3 @@
exclude :test_big_integers, "needs investigation"
exclude :test_load, "needs investigation"
exclude :test_parse_json_primitive_values, "needs investigation"
1 change: 1 addition & 0 deletions test/mri/excludes_truffle/TestJSONEncoding.rb
@@ -0,0 +1 @@
exclude :test_generate, "needs investigation"
2 changes: 2 additions & 0 deletions test/mri/excludes_truffle/TestJSONGenerate.rb
@@ -0,0 +1,2 @@
exclude :test_json_generate, "needs investigation"
exclude :test_gc, "needs investigation"
1 change: 1 addition & 0 deletions test/mri/excludes_truffle/TestJSONStringMatching.rb
@@ -0,0 +1 @@
exclude :test_match_date, "needs investigation"
2 changes: 2 additions & 0 deletions test/mri/excludes_truffle/TestJSONUnicode.rb
@@ -0,0 +1,2 @@
exclude :test_chars, "needs investigation"
exclude :test_unicode, "needs investigation"
14 changes: 7 additions & 7 deletions test/mri_truffle.index
Expand Up @@ -46,13 +46,13 @@ fileutils/test_verbose.rb
io/console/test_io_console.rb
# io/nonblock/test_flush.rb
# io/wait/test_io_wait.rb
# json/test_json.rb
# json/test_json_addition.rb
# json/test_json_encoding.rb
# json/test_json_fixtures.rb
# json/test_json_generate.rb
# json/test_json_generic_object.rb
# json/test_json_string_matching.rb
json/test_json.rb
# json/test_json_addition.rb # cannot load such file -- bigdecimal
json/test_json_encoding.rb
json/test_json_fixtures.rb
json/test_json_generate.rb
json/test_json_generic_object.rb
json/test_json_string_matching.rb
# json/test_json_unicode.rb
# logger/test_logger.rb # library not added, needs file
matrix/test_matrix.rb
Expand Down
Expand Up @@ -1054,7 +1054,7 @@ public RubyString stringResizeCapacity(RubyString string, int capacity) {

}

@RubiniusPrimitive(name = "string_rindex")
@RubiniusPrimitive(name = "string_rindex", lowerFixnumParameters = 1)
public static abstract class StringRindexPrimitiveNode extends RubiniusPrimitiveNode {

public StringRindexPrimitiveNode(RubyContext context, SourceSection sourceSection) {
Expand Down

0 comments on commit e75cd2d

Please sign in to comment.