Граф коммитов

282 Коммитов

Автор SHA1 Сообщение Дата
Watson d7fa7e2c86
[flori/json] Convert string encoding to UTF-8 only when needed
## Before
```
$ ruby bench_json_generate.rb
Warming up --------------------------------------
                json   129.000  i/100ms
Calculating -------------------------------------
                json      1.300k (± 2.3%) i/s -      6.579k in   5.064656s
```

## After
```
$ ruby bench_json_generate.rb
Warming up --------------------------------------
                json   189.000  i/100ms
Calculating -------------------------------------
                json      1.964k (± 3.3%) i/s -      9.828k in   5.011237s
```

## Code
```
require 'json'
require 'benchmark/ips'

obj = []

1000.times do |i|
  obj << {
    "id" => i,
    :age => 42,
  }
end

Benchmark.ips do |x|
  x.report "json" do |iter|
    count = 0
    while count < iter
      JSON.generate(obj)
      count += 1
    end
  end
end
```

https://github.com/flori/json/commit/c34d01ff6a
2019-10-14 19:54:48 +09:00
Watson 40724d7d10
[flori/json] Convert String encoding using `rb_str_encode()`
`rb_funcall` might be slightly heavy to call the Ruby method.
This patch will convert String encoding using `rb_str_encode()` instead of `rb_funcall()`.

## Before
```
$ ruby bench_json_generate.rb
Warming up --------------------------------------
                json    78.000  i/100ms
Calculating -------------------------------------
                json    789.781  (± 2.7%) i/s -      3.978k in   5.041043s
```

## After
```
$ ruby bench_json_generate.rb
Warming up --------------------------------------
                json   129.000  i/100ms
Calculating -------------------------------------
                json      1.300k (± 2.3%) i/s -      6.579k in   5.064656s
```

## Code
```
require 'json'
require 'benchmark/ips'

obj = []

1000.times do |i|
  obj << {
    "id" => i,
    :age => 42,
  }
end

Benchmark.ips do |x|
  x.report "json" do |iter|
    count = 0
    while count < iter
      JSON.generate(obj)
      count += 1
    end
  end
end
```

https://github.com/flori/json/commit/9ae6d2969c
2019-10-14 19:54:48 +09:00
Watson 641136c4af
[flori/json] Does not check whether illegal utf-8 if string has ascii only.
## Before
```
$ ruby bench_json_generate.rb
Warming up --------------------------------------
                json    25.000  i/100ms
Calculating -------------------------------------
                json    250.478  (± 4.8%) i/s -      1.250k in   5.002238s
```

## After
```
$ ruby bench_json_generate.rb
Warming up --------------------------------------
                json    32.000  i/100ms
Calculating -------------------------------------
                json    360.652  (± 3.6%) i/s -      1.824k in   5.064511s
```

## Test code
```
require 'json'
require 'benchmark/ips'

obj = []

1000.times do |i|
  obj << {
    :string => "x" * 100,
    :utf8 => "あ" * 100
  }
end

Benchmark.ips do |x|
  x.report "json" do |iter|
    count = 0
    while count < iter
      JSON.generate(obj)
      count += 1
    end
  end
end
```

https://github.com/flori/json/commit/91a24ecac3
2019-10-14 19:54:48 +09:00
Sho Hashimoto d9e50fcbeb
[flori/json] Pass args all #to_json in json/add/*.
https://github.com/flori/json/commit/36a7ef6790
2019-10-14 19:54:48 +09:00
Florian Frank 7376d70cb0
[flori/json] Only attempt to resize strings not other objects
https://github.com/flori/json/commit/167ada8da7
2019-10-14 19:54:48 +09:00
Yusuke Endoh 96452373fd ext/json/parser/prereq.mk: use `if $. == 1` instead of a hacky code 2019-10-05 18:28:19 +09:00
Yusuke Endoh 70e3fda2eb ext/json/parser/prereq.mk: keep line numbers of ext/json/parser/parser.c
Follow up of 5717e55e9a.
Adding a header with newline broke linenos.
2019-10-05 17:54:36 +09:00
Yusuke Endoh 417c64b9a8 ext/json/parser/parser.rl: Use "signed" char to contain negative values
char is not always signed.  In fact, it is unsigned in arm.

https://rubyci.org/logs/rubyci.s3.amazonaws.com/scw-9d6766/ruby-master/log/20191004T181708Z.log.html.gz
```
compiling parser.c
parser.rl: In function ‘unescape_unicode’:
parser.rl:50:5: warning: comparison is always false due to limited range of data type [-Wtype-limits]
     if (b < 0) return UNI_REPLACEMENT_CHAR;
     ^
```
2019-10-05 07:00:57 +09:00
Yusuke Endoh 5717e55e9a ext/json/parser/prereq.mk: Add a "automatically generated" header
to parser.c.
2019-10-05 07:00:07 +09:00
Yusuke Endoh 076d3d758b ext/json/parser/parser.rl: Update the source code of parser.c
There have been some direct changes in parser.c which is automatically
generated from parser.rl.  This updates parser.rl to sync the changes:

* 91793b8967
* 79ead821dd
* 80b5a0ff2a
2019-10-05 06:34:40 +09:00
Jeremy Evans 80b5a0ff2a
Make rb_scan_args handle keywords more similar to Ruby methods (#2460)
Cfuncs that use rb_scan_args with the : entry suffer similar keyword
argument separation issues that Ruby methods suffer if the cfuncs
accept optional or variable arguments.

This makes the following changes to : handling.

* Treats as **kw, prompting keyword argument separation warnings
  if called with a positional hash.

* Do not look for an option hash if empty keywords are provided.
  For backwards compatibility, treat an empty keyword splat as a empty
  mandatory positional hash argument, but emit a a warning, as this
  behavior will be removed in Ruby 3.  The argument number check
  needs to be moved lower so it can correctly handle an empty
  positional argument being added.

* If the last argument is nil and it is necessary to treat it as an option
  hash in order to make sure all arguments are processed, continue to
  treat the last argument as the option hash. Emit a warning in this case,
  as this behavior will be removed in Ruby 3.

* If splitting the keyword hash into two hashes, issue a warning, as we
  will not be splitting hashes in Ruby 3.

* If the keyword argument is required to fill a mandatory positional
  argument, continue to do so, but emit a warning as this behavior will
  be going away in Ruby 3.

* If keyword arguments are provided and the last argument is not a hash,
  that indicates something wrong. This can happen if a cfunc is calling
  rb_scan_args multiple times, and providing arguments that were not
  passed to it from Ruby.  Callers need to switch to the new
  rb_scan_args_kw function, which allows passing of whether keywords
  were provided.

This commit fixes all warnings caused by the changes above.

It switches some function calls to *_kw versions with appropriate
kw_splat flags. If delegating arguments, RB_PASS_CALLED_KEYWORDS
is used.  If creating new arguments, RB_PASS_KEYWORDS is used if
the last argument is a hash to be treated as keywords.

In open_key_args in io.c, use rb_scan_args_kw.
In this case, the arguments provided come from another C
function, not Ruby.  The last argument may or may not be a hash,
so we can't set keyword argument mode.  However, if it is a
hash, we don't want to warn when treating it as keywords.

In Ruby files, make sure to appropriately use keyword splats
or literal keywords when calling Cfuncs that now issue keyword
argument separation warnings through rb_scan_args.  Also, make
sure not to pass nil in place of an option hash.

Work around Kernel#warn warnings due to problems in the Rubygems
override of the method.  There is an open pull request to fix
these issues in Rubygems, but part of the Rubygems tests for
their override fail on ruby-head due to rb_scan_args not
recognizing empty keyword splats, which this commit fixes.

Implementation wise, adding rb_scan_args_kw is kind of a pain,
because rb_scan_args takes a variable number of arguments.
In order to not duplicate all the code, the function internals need
to be split into two functions taking a va_list, and to avoid passing
in a ton of arguments, a single struct argument is used to handle
the variables previously local to the function.
2019-09-25 11:18:49 -07:00
Nobuyoshi Nakada 715955ff27
Include ruby/assert.h in ruby/ruby.h so that assertions can be there 2019-07-14 17:58:03 +09:00
Nobuyoshi Nakada dcb8c41a1e
Added depend files 2019-07-14 01:31:29 +09:00
Nobuyoshi Nakada 331eccf3fe
Removed useless `freeze`s from gemspec files 2019-07-13 07:25:54 +09:00
Nobuyoshi Nakada fd9f26df00
Drop fossil rubygems support 2019-07-13 07:25:54 +09:00
Nobuyoshi Nakada 1ee17782e1
Removed binary line 2019-07-13 06:09:33 +09:00
Nobuyoshi Nakada 2a8be8ec33
Suppress uninitialized instance variable warnings 2019-07-09 08:31:27 +09:00
Aaron Patterson 79ead821dd
Add NaN / Infinity / MinusInfinity to mark list
This prevents the constants from moving.
2019-05-13 14:27:54 -07:00
tenderlove 91793b8967 Add `GC.compact` again.
🙏

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67620 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-20 01:19:47 +00:00
tenderlove 744e5df715 Reverting compaction for now
For some reason symbols (or classes) are being overridden in trunk

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67598 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-17 09:41:41 +00:00
tenderlove 3c55b643ae Adding `GC.compact` and compacting GC support.
This commit adds the new method `GC.compact` and compacting GC support.
Please see this issue for caveats:

  https://bugs.ruby-lang.org/issues/15626

[Feature #15626]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67576 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-17 03:17:25 +00:00
kazu 25c1fd3b90 Reverting all commits from r67479 to r67496 because of CI failures
Because hard to specify commits related to r67479 only.
So please commit again.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67499 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-10 09:15:21 +00:00
tenderlove e385c159da Add error globals to mark list so they don't move
JSON gem is referencing constants defined in Ruby then keeping a
reference as a global.  We need to register these globals so they stay
pinned.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67483 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-09 21:13:32 +00:00
hsbt 6604e1b7cd Merge json-2.2.0 from flori/json.
https://github.com/flori/json/releases/tag/v2.2.0

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67127 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-02-23 03:43:58 +00:00
nobu d1e6304a89 Prefer relative directory from srcdir to top_srcdir
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67073 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-02-14 05:42:14 +00:00
nobu 63f990674b Use $(hdrdir) for include/ruby.h, as well as r67033
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67051 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-02-11 13:43:14 +00:00
mrkn a7e3516ff1 Fix JSON::Parser against bigdecimal updates
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66127 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-02 05:21:57 +00:00
hsbt b891d95e85 Removed control characters from gemspec.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65461 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-31 00:13:56 +00:00
eregon e7da0fc34e ext/json/parser/parser.c: do not call rb_str_resize() on Time object
* See https://github.com/flori/json/issues/342

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64177 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-03 15:11:36 +00:00
eregon bf226a9ac4 Fix missed update of parser source in r62429
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64175 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-03 15:11:22 +00:00
nobu c8094ff154 no ID cache in Init functions
Init functions are called only once, cache is useless.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62429 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-16 08:39:48 +00:00
hsbt b304078ae6 Merge json-2.1.0 from https://github.com/flori/json
https://github.com/flori/json/blob/master/CHANGES.md#2017-04-18-210

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59099 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-06-16 03:04:46 +00:00
hsbt 83735ba29a Merge json-2.0.4.
* https://github.com/flori/json/releases/tag/v2.0.4
  * 09fabeb03e/CHANGES.md (2017-03-23-204)

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58323 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-12 00:21:18 +00:00
shyouhei 20c72dc89d ruby tool/update-deps --fix
Onigumo 6 (r57045) introduced new onigumo.h header file, which is
required from quite much everywhere.  This commit adds necessary
dependencies.

Note: ruby/oniguruma.h now includes onigumo.h,
      ruby/io.h includes oniguruma.h,
      ruby/encoding.h also includes oniguruma.h,
      and internal.h includes encoding.h.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58054 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-22 06:00:18 +00:00
nobu c2d77880c0 Fix rdoc of OpenStruct.json_create [ci skip]
* ext/json/lib/json/add/ostruct.rb (OpenStruct.json_create):
  Correct documentation, fix the name of values.  [Fix GH-1421]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56038 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-08-30 06:27:29 +00:00
hsbt 11a94f2a36 * ext/json/*, test/json/json_parser_test.rb: Update json-2.0.2.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55784 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-08-01 03:16:30 +00:00
nobu 6c1f4f7eba json/ext: remove stale directory
* ext/json/lib/json/ext: remove stale directory.  bundled
  extension libraries are placed under the directory for each
  architectures, but not mixed with plain text script libraries.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55675 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-07-14 04:10:56 +00:00
svn a9acbeed78 * append newline at EOF.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55673 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-07-14 03:48:55 +00:00
hsbt bf7cc652ae * ext/json/**/*.rb: merge original files from upstream repository.
It only fixes styles of frozen string literal.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55671 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-07-14 03:48:54 +00:00
nobu 9df9432181 Revert ext/json/parser/prereq.mk
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55583 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-07-06 05:01:43 +00:00
svn 3345322572 * append newline at EOF.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55577 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-07-05 11:49:40 +00:00
hsbt 1130658738 * ext/json/*, test/json/*: Update json-2.0.1.
Changes of 2.0.0: f679ebd0c6/CHANGES.md (2015-09-11-200)
  Changes of 2.0.1: f679ebd0c6/CHANGES.md (2016-07-01-201)
  [Feature #12542][ruby-dev:49706][fix GH-1395]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55576 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-07-05 11:49:39 +00:00
nobu c071c05229 Integer unification macro
* include/ruby/ruby.h (RUBY_INTEGER_UNIFICATION): macro to tell if
  Integer is integrated.  [ruby-core:75718][Bug #12427]
* include/ruby/backward.h, internal.h (rb_cFixnum, rb_cBignum):
  fallback to rb_cInteger.
* bignum.c, numeric.c, ext/json/generator/generator.{c,h}: use the
  macro.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55394 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-06-13 11:34:56 +00:00
hsbt 3261d3f3cc * ext/json/lib/*.rb: Removed some comments. Because these are unnecessary
class description. [ci skip][Bug #12255][ruby-core:74835]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55380 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-06-11 09:38:04 +00:00
akr f9727c12cc [Feature #12005] Unify Fixnum and Bignum into Integer
* [Feature #12005] Unify Fixnum and Bignum into Integer

* include/ruby/ruby.h (rb_class_of): Return rb_cInteger for fixnums.

* insns.def (INTEGER_REDEFINED_OP_FLAG): Unified from
  FIXNUM_REDEFINED_OP_FLAG and BIGNUM_REDEFINED_OP_FLAG.

* vm_core.h: Ditto.

* vm_insnhelper.c (opt_eq_func): Use INTEGER_REDEFINED_OP_FLAG instead
  of FIXNUM_REDEFINED_OP_FLAG.

* vm.c (vm_redefinition_check_flag): Use rb_cInteger instead of
  rb_cFixnum and rb_cBignum.
  (C): Use Integer instead of Fixnum and Bignum.

* numeric.c (fix_succ): Removed.
  (Init_Numeric): Define Fixnum as Integer.

* bignum.c (bignew): Use rb_cInteger instead of Rb_cBignum.
  (rb_int_coerce): replaced from rb_big_coerce and return fixnums
  as-is.
  (Init_Bignum): Define Bignum as Integer.
  Don't define ===.

* error.c (builtin_class_name): Return "Integer" for fixnums.

* sprintf.c (ruby__sfvextra): Use rb_cInteger instead of rb_cFixnum.

* ext/-test-/testutil: New directory to test.
  Currently it provides utilities for fixnum and bignum.

* ext/json/generator/generator.c: Define mInteger_to_json.

* lib/mathn.rb (Fixnum#/): Redefinition removed.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55024 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-17 06:53:48 +00:00
akr 9d8ef4ea20 Update dependencies.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54544 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-04-11 11:50:00 +00:00
naruse c4fdfabcc8 handle ext/ as r53141
g -L frozen_string_literal ext/**/*.rb|xargs ruby -Ka -e'ARGV.each{|fn|puts
fn;open(fn,"r+"){|f|s=f.read.sub(/\A(#!.*\n)?(#.*coding.*\n)?/,"\\&#
frozen_string_literal: false\n");f.rewind;f.write s}}'

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53143 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-16 05:31:54 +00:00
hsbt 1f1e3d1297 * ext/json/json.gemspec: bump version to json 1.8.3. CRuby already contained
upstream changes.
  4d059bf9f5
  d4c99de789
* ext/json/lib/json/version.rb: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52899 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-05 23:40:24 +00:00
nobu 460152ea73 parser.c: update
* ext/json/parser/parser.c: update to r51946.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51937 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-09-25 08:08:58 +00:00
nobu f12fccbec5 parser.rl: rb_scan_args
* ext/json/parser/parser.rl (cParser_initialize): use ':' in
  rb_scan_args.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51936 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-09-25 08:06:57 +00:00
nobu 4d059bf9f5 generator.c: allocate structs with wrapper
* ext/json/generator/generator.c (cState_s_allocate): allocate
  structs with making new wrapper objects and get rid of potential
  memory leak.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50661 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-28 07:17:55 +00:00
nobu cbf902fc33 parser.rl: allocate structs with wrapper
* ext/json/parser/parser.rl (cJSON_parser_s_allocate): allocate
  structs with making new wrapper objects and get rid of potential
  memory leak.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50660 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-28 07:17:42 +00:00
nobu 5c0df05b92 parser.rl: define enc_raise iff necessary
* ext/json/parser/parser.rl (enc_raise): no needs if rb_enc_raise
  is available.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50343 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-18 06:24:38 +00:00
nobu b38c0b7974 parser.rl: rb_enc_raise
* ext/json/parser/parser.rl: raise with messages in UTF-8
  encoding.  [ruby-core:67386] [Bug #10705]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50342 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-18 06:19:52 +00:00
nobu f47dc0738a parser.rl: use rb_encoding
* ext/json/parser/parser.rl (convert_encoding): use rb_encoding
  functions to compare and convert encodings.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50340 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-18 06:18:50 +00:00
nobu 6583e5dbfa parser.rl: use StringValue
* ext/json/parser/parser.rl (cParser_initialize): use StringValue
  instead of direct rb_convert_type and remove duplicate
  conversion.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50339 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-18 06:18:37 +00:00
hsbt 1bc5669857 * ext/json/json.gemspec: bump version to 1.8.2.
* ext/json/lib/json/version.rb: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50270 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-12 09:40:11 +00:00
hsbt 9829e91d34 * ext/json/json.gemspec, lib/rdoc/rdoc.gemspec: added gemspec directly.
* defs/default_gems, tool/rbinstall.rb: removed default_gems definition.
  it make simple installation for default gems.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50269 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-12 09:12:15 +00:00
hsbt 2e4f0af00f * ext/json/*, test/json/*: Reverted r50231. Because it's not works with
cross-compile environment.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50267 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-12 08:36:37 +00:00
hsbt cfaddc2a32 * ext/json/*, test/json/*, defs/default_gems: Gemify JSON library.
[fix GH-867][Feature #11057]
* test/ruby/test_extlibs.rb: removed json gem from existence extentions.
* gems/bundled_gems: added json gem into bundled gem.
* lib/rdoc/rubygems_hook.rb: ignored no json environment.
* lib/rubygems/test_case.rb, test/rubygems/*: ditto.
* lib/rdoc/test_case.rb, test/rdoc/*: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50231 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-11 11:14:36 +00:00
hsbt f5219fee63 * ext/json: merge upstream from flori/json
change usage of TypedData. [Feature #10739][ruby-core:67564]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49582 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-02-13 05:19:12 +00:00
nobu e5c516c89a generator.c: fix infinite recursion
* ext/json/generator/generator.c (generate_json): get rid of
  unnecessary recursive calls which can cause infinite recursion.
  T_STRING may not have rb_cString.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49562 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-02-11 02:01:36 +00:00
hsbt 8f37674ffd * ext/json, test/json: merge JSON HEAD(259dee6)
separate imprementation of Typed_Data macro.
  https://github.com/flori/json/compare/v1.8.1...v1.8.2

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49236 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-01-13 12:08:28 +00:00
nobu c0ee6f2af9 generic_object.rb: useless methods
* ext/json/lib/json/generic_object.rb (JSON::GenericObject):
  remove useless overriding methods, [] and []=.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49161 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-01-06 05:32:41 +00:00
svn 6a488fdeda * append newline at EOF.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49052 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-12-28 22:29:27 +00:00
hsbt 4a481ad400 * ext/json, test/json: merge JSON HEAD(17fe8e7)
https://github.com/flori/json/compare/v1.8.1...17fe8e7

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49051 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-12-28 22:29:11 +00:00
nobu 5547719573 ext/json: for ancient backward compatibilities
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49050 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-12-28 17:03:36 +00:00
nobu cc5b3577a0 generator.h: use GET_STATE_TO
* ext/json/generator/generator.h (GENERATE_JSON): use GET_STATE_TO
  macro, instead of TypedData_Get_Struct directly.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49048 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-12-28 16:50:55 +00:00
nobu d29ff24793 json: backward compatibilities
* ext/json/generator/generator.c (JSON_Generator_State_type): add
  #ifdef for backward compatibility.
* ext/json/parser/parser.rl (JSON_Parser_type): ditto.
* ext/json/generator/generator.h (ZALLOC): add fallback definition.
* ext/json/parser/parser.h (ZALLOC): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49038 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-12-27 11:12:58 +00:00
nobu 993f22cb1b parser.rl: check before use
* ext/json/parser/parser.rl (unescape_unicode): check if valid
  before bit-or assignments.
  reported by Denis Denisov <denji0k AT gmail.com>.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49027 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-12-26 06:13:15 +00:00
akr ecedd3b224 Update dependencies.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48898 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-12-19 13:34:54 +00:00
nobu e580a631be use 0 for reserved
use 0 for rb_data_type_t::reserved instead of NULL, since its type
may be changed in the future and possibly not a pointer type.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48662 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-12-01 06:38:04 +00:00
akr 6ca202fcee Update dependency.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48526 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-21 03:04:44 +00:00
akr dd547e1b22 Mark auogenerated part.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48441 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-15 11:14:08 +00:00
akr 57682b05e1 * common.mk: Remove comments in Dependency lines.
Notified by usa.

* enc/depend: Ditto.

* ext/**/depend: Ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48434 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-15 10:28:25 +00:00
akr 8727eb77be * tool/update-deps: Extend to fix dependencies.
* common.mk: Dependencies updated by tool/update-deps.

* enc/depend: Ditto.

* ext/**/depend: Ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48431 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-15 05:15:49 +00:00
nobu 1e46f02394 json/parser: typed data
* ext/json/parser/parser.rl (JSON_Parser_type): turn into typed
  data.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47798 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-04 23:33:11 +00:00
nobu bdfc2e2942 json/generator: typed data
* ext/json/generator/generator.c (JSON_Generator_State_type): turn
  into typed data.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47797 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-04 23:33:09 +00:00
nobu ba0655ebdd ext: protoize no-arguments functions
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47793 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-04 23:29:24 +00:00
nobu 5540c1de81 ext: protoize no-arguments functions
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47792 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-04 23:09:32 +00:00
nobu dc70a9c422 fbuffer.h: expand arguments
* ext/json/fbuffer/fbuffer.h (fbuffer_to_s): expand arguments, for
  fix with rb_str_new macro.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47626 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-09-18 14:51:45 +00:00
nobu d90075cb10 json/parser/prereq.mk: use enum
* ext/json/parser/prereq.mk (parser.c): use `enum` instead of
  `static const int` to get rid of unused-const-variable warnings.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45356 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-03-17 04:57:19 +00:00
nobu 1f29e8e2ba class.c: do nothing if copying self
* class.c (rb_mod_init_copy): do nothing if copying self.
  [ruby-dev:47989] [Bug #9535]
* hash.c (rb_hash_initialize_copy): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45076 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-21 11:42:03 +00:00
nobu cfa2a21062 ext/json: backward compatibilities
* ext/json/fbuffer/fbuffer.h, ext/json/generator/generator.c: add
  macros for backward compatibilities.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44615 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-15 08:16:46 +00:00
tmm1 738b8872ef ext/json: objects depend on $(ruby_headers)
* ext/json/generator/depend: add build dependencies for json extension
  Patch by normalperson (Eric Wong) [Bug #9374] [ruby-core:59609]
* ext/json/parser/depend: ditto

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44514 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-07 01:13:46 +00:00
a_matsuda da66677061 * lib/irb/notifier.rb: [Doc] Fix typo
* ext/json/lib/json/common.rb:  Ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43881 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-27 12:56:08 +00:00
naruse 14cab32596 * ext/json: merge JSON 1.8.1.
002ac2771c...e09ffc0d7d
* Remove Rubinius exception since transcoding should be working now.
* Fix https://github.com/flori/json/issues/162 reported by Marc-Andre
  Lafortune <github_rocks@marc-andre.ca>. Thanks!
* Applied patches by Yui NARUSE <naruse@airemix.jp> to suppress
  warning with -Wchar-subscripts and better validate UTF-8 strings.
* Applied patch by ginriki@github to remove unnecessary if.
* Add load/dump interface to JSON::GenericObject to make
  serialize :some_attribute, JSON::GenericObject
  work in Rails active models for convenient
  SomeModel#some_attribute.foo.bar access to serialised JSON data.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43731 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-20 02:55:08 +00:00
nobu 3f78d84661 Eliminate less-than-zero checks for unsigned variables
* ext/bigdecimal/bigdecimal.c, ext/digest/md5/md5.c,
  ext/json/fbuffer/fbuffer.h, ext/json/generator/generator.c:
  Eliminate less-than-zero checks for unsigned variables.
  According to section 4.1.5 of C89 standard, size_t is an unsigned
  type.  These checks were found with 'cppcheck' static analysis tool.
  [ruby-core:57117] [Feature #8890]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42920 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-12 13:37:11 +00:00
nobu b4e9b0d19c json/add/range.rb: use Range#end
* ext/json/lib/json/add/range.rb (Range#as_json): use Range#end
  instead of Range#last which can be affected by Range#exclusive?.
  ref [Bug #8739]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42404 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-08-06 12:38:53 +00:00
hsbt 7eeb65397d fixup stying of `Json#generate` parameter docs by @daveworth [fixes GH-339]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41862 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-07-09 11:48:19 +00:00
naruse cac2f455a9 * ext/json/fbuffer/fbuffer.h (fbuffer_append_str): change the place of
RB_GC_GUARD. it should be after the object is used.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41135 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-07 04:45:16 +00:00
naruse ce573f3166 * ext/json/generator/generator.c (isArrayOrObject): cast char to
unsigned char. [Bug #8378]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40609 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-08 05:00:02 +00:00
naruse 279c7bdd88 * ext/json/generator/depend: fix dependencies [Bug #8379]
* ext/json/parser/depend: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40608 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-08 04:59:52 +00:00
zzak 3a7a773aeb * ext/socket/option.c: Document synonymous methods, by windwiny [GH-277]
* ext/stringio/stringio.c: ditto
* ext/io/wait/wait.c: ditto
* ext/gdbm/gdbm.c: ditto
* ext/dl/cfunc.c: ditto
* ext/zlib/zlib.c: ditto
* ext/win32ole/win32ole.c: ditto
* ext/dbm/dbm.c: ditto
* ext/json/generator/generator.c: ditto
* ext/date/date_core.c: ditto


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40319 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-16 03:25:50 +00:00
naruse 062d2ee6f7 * ext/json: merge JSON 1.7.7.
This includes security fix. [CVE-2013-0269]
  d0a62f3ced
  https://groups.google.com/d/topic/rubyonrails-security/4_YvCpLzL58/discussion

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39208 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-02-12 03:05:45 +00:00
zzak 53bc349069 * ext/json/lib/json.rb: Move module overview definition for rdoc
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39046 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-02-04 19:39:15 +00:00
naruse 43f6fdfb42 * ext/json: merge JSON 1.7.5.
fix tests and other fixes.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38346 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-12 10:51:49 +00:00
nobu 396903d384 depend: dependency
* ext/json/generator/depend: fix missing dependency.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37073 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-03 07:33:24 +00:00
nobu 30fbd739a1 fix dependency
* ext/json/parser/depend: fix dependency for error that rb_float_new
  is not found.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36859 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-08-31 04:58:18 +00:00
kanemoto 48cb947793 avoid compilation error on AIX by -ansi -std=iso9899:199409 (r36038). [ruby-core:46744] [Bug #6791].
This issue is fixed in upper stream as issue #142. (https://github.com/flori/json/issues/142)



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36541 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-25 22:26:41 +00:00
nobu c196e22a42 Revert r35684 "* trunk/ext/json/extconf.rb: remove fake file."
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35693 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-05-18 08:26:10 +00:00
nobu d17b97ce64 * trunk/ext/json/extconf.rb: remove fake file.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35684 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-05-18 05:06:49 +00:00
nobu 9c4fc91c6b * ext/json/lib/json/generic_object.rb: missing file.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35573 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-05-07 18:44:36 +00:00
naruse 5a00be2bf7 * ext/json: Merge JSON 1.7.1.
e5b9a9465c

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35568 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-05-07 16:00:49 +00:00
naruse 251001c829 Revert r35560.
This breaks tests:
http://u64.rubyci.org/~chkbuild/ruby-trunk/log/20120507T070102Z.log.html.gz

And don't change local codes, contribute it to upstream:
https://github.com/flori/json

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35562 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-05-07 08:46:50 +00:00
usa e9231035b2 * ext/json/parser/depend: need to specify the base directory for nmake.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35561 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-05-07 08:25:02 +00:00
nobu 0bd56268cb ext/json/fbuffer/fbuffer.h
* ext/json/fbuffer/fbuffer.h: comment-out unused functions.

* ext/json/parser/depend: add dependency.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35560 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-05-07 05:11:45 +00:00
naruse 164ced04de Add debug prints to inspect TC_JSONGenerate#test_gc's timeout issue.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35336 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-15 07:37:45 +00:00
naruse e0ba59b708 Additional experimental fix for r35261.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35264 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-08 19:17:32 +00:00
naruse fdc3882820 * ext/json/generator/generator.c (generate_json_bignum):
add RB_GC_GUARD.
  http://fb.rubyci.org/~chkbuild/ruby-trunk/log/20120407T210301Z.diff.html.gz

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35261 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-08 13:46:53 +00:00
naruse 199d1fa924 Add missing files of r34971,
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34973 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-11 17:42:18 +00:00
naruse 4d8d3184d1 * ext/json: Merge 164a75c8bd2007d32c4d7665d53140d8fc126dcd.
[ruby-core:41917] [Bug #5846]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34971 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-11 13:36:06 +00:00
naruse c358a4cba1 * ext/json/parser/parser.rl (json_string_unescape): workaround fix
for over optimization of GCC 4.7. [ruby-core:42085] [Bug #5888]
  http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51862

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34306 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-01-15 06:52:36 +00:00
naruse 179cf473c2 Fix typo: U+0456->U+0069. [Bug #5275]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33192 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-05 09:05:13 +00:00
naruse c06658feba * ext/json: Merge json gem v1.5.4 (3dab4c5a6a97fac03dac).
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33142 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-31 06:56:16 +00:00
naruse 28bba481f9 Don't include complex and rational; fix r33122.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33124 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-30 05:21:27 +00:00
naruse b14c060dda * ext/json: Merge json gem 1.5.4+ (2149f4185c598fb97db1).
[Bug #5173] [ruby-core:38866]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33122 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-30 02:23:12 +00:00
naruse a2e497d5ed * ext/json: Merge json gem 1.5.4+ (f7f78896607b6f6226cd).
[Bug #4700]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32493 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-10 08:01:04 +00:00
nobu 29e497d231 * ext/json/{generator/generator.c,parser/parser.rl}: fix indent.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32460 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-08 09:00:54 +00:00
nobu bc1fd9458d * ext/json/parser/parser.rl (JSON_parse_object): add missing parens.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32459 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-08 09:00:51 +00:00
nobu 4902ef7d59 * ext/json/parser/parser.rl (convert_encoding): should not modify
the argument.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32458 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-08 07:40:41 +00:00
nobu b16fd08622 * ext/json/parser/parser.rl (convert_encoding): no needs to use
force_encoding.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32457 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-08 07:39:09 +00:00
nobu c23dea553e * ext/json/parser/prereq.mk: remove trailing spaces.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32455 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-08 07:01:16 +00:00
nobu 3a47cf3395 * remove trailing spaces.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31573 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-15 11:55:52 +00:00
nobu b5f628a84a * ext/json/lib/json/common.rb (JSON::MissingUnicodeSupport.iconv):
should not drop rest of the result.  use Iconv.conv instead.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30807 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-02-06 04:48:49 +00:00
nobu 1069e5d665 * ext/json/parser/parser.h (GET_PARSER): raise TypeError.
* ext/json/parser/parser.rl (cParser_initialize): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30792 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-02-05 02:29:18 +00:00
nobu 9cc62abc6b * ext/json/parser/parser.h (GET_PARSER): check if initialized.
[ruby-core:35079]
* ext/json/parser/parser.rl (cParser_initialize): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30791 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-02-05 01:30:01 +00:00
nobu bc1e4b4e2a * ext/json/parser/parser.rl: add local variables for emacs.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30790 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-02-05 01:13:41 +00:00
nobu 03ca479728 * ext/json/generator/generator.{c,h} (fbuffer_free_only_buffer):
unused.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30346 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-25 04:49:34 +00:00
nobu 514a5b3b71 * ext/json/generator/generator.c (fbuffer_free): unused.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30338 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-25 01:51:06 +00:00
naruse c20b8f75dd * ext/json/lib/json/add/rails.rb: removed.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30053 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-02 12:28:45 +00:00
naruse 6d74458037 * ext/json/generator/extconf.rb: remove the lines which set -O3
when -O option is not set.
  Note that -O3 doesn't always exist.

* ext/json/parser/extconf.rb: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30011 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-02 01:12:41 +00:00
naruse 521876c373 * ext/json/lib/json/common.rb: don't use iconv on 1.9.
patched by Shota Fukumori [ruby-core:33164]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30004 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-01 16:26:15 +00:00
naruse 4a84c27e3e * ext/json: Update github/flori/json from 1.4.2+ to
e22b2f2bdfe6a9b0. this fixes some bugs.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30003 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-01 16:26:13 +00:00
nobu 8d228b2579 * common.mk (EXT_SRCS): add ext/json/parser/parser.c.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28780 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-07-28 21:51:31 +00:00
nobu b117475e18 * ext/json/generator/generator.c (fbuffer_free): removed unused function.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28692 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-07-20 09:47:50 +00:00
naruse 7021db80f3 * ext/json/generator/generator.c (fbuffer_inc_capa):
fix tha use of REALLOC_N. [ruby-dev:41227]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27694 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-09 00:50:36 +00:00
nobu 5d379991de * ext/json/{generator/generator.c,parser/parser.rl}: fixed indent.
* ext/json/{generator,parser}/depend: added.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27692 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-09 00:30:12 +00:00
naruse dc22009c26 * ext/json: Update to JSON 1.4.2.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27535 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-28 14:26:30 +00:00
usa 76b33197e2 * ext/json/generator/generator.c (convert_UTF8_to_JSON_ASCII): get rid
of a warning.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27502 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-26 06:43:36 +00:00
naruse 3642494ce5 Recommit of JSON; fix mixed declarations.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27501 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-26 06:27:27 +00:00
usa 27be3056dc * ext/jason: revert r27493. came again after canceling gcc-ism.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27500 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-26 04:34:36 +00:00
naruse 54592ad627 * ext/json: Update to JSON 1.4.1.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27493 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-26 00:06:35 +00:00
nobu 977267c2e0 * ext/**/*.[ch]: removed trailing spaces.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27437 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-22 08:04:13 +00:00
nobu 4e637b320f * ext/json/lib/**/*.rb: not executable.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26811 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-04 01:05:00 +00:00
nobu dc087bf85d * ext/json/lib/json/common.rb (recurse_proc): removed needless
module_function, since visibility is already module_function.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25153 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-29 08:02:47 +00:00
naruse e662770dc9 * ext/json/ext/generator/generator.c: Documention patch by okkez.
[Bug #2075]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25114 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-26 20:37:06 +00:00
nobu a4fbd748e2 * configure.in (GCC): subst for GCC depending extension libraries.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24861 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-12 08:31:44 +00:00
naruse d17fe8a467 NaN is now 0.0/0 because of 1.8/1.9 compat.
* ext/json/lib/json/common.rb (NaN): Change definition
  of NaN to 0.0/0 for 1.8/1.9 compatibility.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24730 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-01 17:35:30 +00:00
naruse c719ecb535 * ext/json: Update to JSON 1.1.9.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24727 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-01 16:17:56 +00:00