<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/ext/json/parser, branch ruby_2_7</title>
<subtitle>The Ruby Programming Language</subtitle>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/'/>
<entry>
<title>[flori/json] Only attempt to resize strings not other objects</title>
<updated>2019-10-14T10:54:48+00:00</updated>
<author>
<name>Florian Frank</name>
<email>flori@ping.de</email>
</author>
<published>2019-04-29T13:56:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=7376d70cb0817158a9ce0ef433872be5ca7af56b'/>
<id>7376d70cb0817158a9ce0ef433872be5ca7af56b</id>
<content type='text'>
https://github.com/flori/json/commit/167ada8da7
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/flori/json/commit/167ada8da7
</pre>
</div>
</content>
</entry>
<entry>
<title>ext/json/parser/prereq.mk: use `if $. == 1` instead of a hacky code</title>
<updated>2019-10-05T09:28:19+00:00</updated>
<author>
<name>Yusuke Endoh</name>
<email>mame@ruby-lang.org</email>
</author>
<published>2019-10-05T09:28:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=96452373fd192ada49c831386e033531e2263a52'/>
<id>96452373fd192ada49c831386e033531e2263a52</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>ext/json/parser/prereq.mk: keep line numbers of ext/json/parser/parser.c</title>
<updated>2019-10-05T08:54:36+00:00</updated>
<author>
<name>Yusuke Endoh</name>
<email>mame@ruby-lang.org</email>
</author>
<published>2019-10-05T08:54:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=70e3fda2eb45c841e5fb4574273d20f8df5455e5'/>
<id>70e3fda2eb45c841e5fb4574273d20f8df5455e5</id>
<content type='text'>
Follow up of 5717e55e9a7790c938afa694a9bf558c0e54bb83.
Adding a header with newline broke linenos.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Follow up of 5717e55e9a7790c938afa694a9bf558c0e54bb83.
Adding a header with newline broke linenos.
</pre>
</div>
</content>
</entry>
<entry>
<title>ext/json/parser/parser.rl: Use "signed" char to contain negative values</title>
<updated>2019-10-04T22:00:57+00:00</updated>
<author>
<name>Yusuke Endoh</name>
<email>mame@ruby-lang.org</email>
</author>
<published>2019-10-04T22:00:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=417c64b9a8c4815a54f9bbef37f4438ee5c2f4fc'/>
<id>417c64b9a8c4815a54f9bbef37f4438ee5c2f4fc</id>
<content type='text'>
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 &lt; 0) return UNI_REPLACEMENT_CHAR;
     ^
```
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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 &lt; 0) return UNI_REPLACEMENT_CHAR;
     ^
```
</pre>
</div>
</content>
</entry>
<entry>
<title>ext/json/parser/prereq.mk: Add a "automatically generated" header</title>
<updated>2019-10-04T22:00:07+00:00</updated>
<author>
<name>Yusuke Endoh</name>
<email>mame@ruby-lang.org</email>
</author>
<published>2019-10-04T22:00:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=5717e55e9a7790c938afa694a9bf558c0e54bb83'/>
<id>5717e55e9a7790c938afa694a9bf558c0e54bb83</id>
<content type='text'>
to parser.c.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
to parser.c.
</pre>
</div>
</content>
</entry>
<entry>
<title>ext/json/parser/parser.rl: Update the source code of parser.c</title>
<updated>2019-10-04T21:34:40+00:00</updated>
<author>
<name>Yusuke Endoh</name>
<email>mame@ruby-lang.org</email>
</author>
<published>2019-10-04T21:30:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=076d3d758b0df47d3dceb3ba0930486f3dd0cc2d'/>
<id>076d3d758b0df47d3dceb3ba0930486f3dd0cc2d</id>
<content type='text'>
There have been some direct changes in parser.c which is automatically
generated from parser.rl.  This updates parser.rl to sync the changes:

* 91793b8967e0531bd1159a8ff0cc7e50739c7620
* 79ead821dd4880725c9c6bb9645b3fad71715c5b
* 80b5a0ff2a7709367178f29d4ebe1c54122b1c27
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
There have been some direct changes in parser.c which is automatically
generated from parser.rl.  This updates parser.rl to sync the changes:

* 91793b8967e0531bd1159a8ff0cc7e50739c7620
* 79ead821dd4880725c9c6bb9645b3fad71715c5b
* 80b5a0ff2a7709367178f29d4ebe1c54122b1c27
</pre>
</div>
</content>
</entry>
<entry>
<title>Make rb_scan_args handle keywords more similar to Ruby methods (#2460)</title>
<updated>2019-09-25T18:18:49+00:00</updated>
<author>
<name>Jeremy Evans</name>
<email>code@jeremyevans.net</email>
</author>
<published>2019-09-25T18:18:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=80b5a0ff2a7709367178f29d4ebe1c54122b1c27'/>
<id>80b5a0ff2a7709367178f29d4ebe1c54122b1c27</id>
<content type='text'>
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.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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.</pre>
</div>
</content>
</entry>
<entry>
<title>Include ruby/assert.h in ruby/ruby.h so that assertions can be there</title>
<updated>2019-07-14T08:58:03+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2019-07-14T04:06:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=715955ff27206351dcf509eb3c60e0927ad9a708'/>
<id>715955ff27206351dcf509eb3c60e0927ad9a708</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Add NaN / Infinity / MinusInfinity to mark list</title>
<updated>2019-05-13T21:27:54+00:00</updated>
<author>
<name>Aaron Patterson</name>
<email>tenderlove@ruby-lang.org</email>
</author>
<published>2019-05-13T21:27:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=79ead821dd4880725c9c6bb9645b3fad71715c5b'/>
<id>79ead821dd4880725c9c6bb9645b3fad71715c5b</id>
<content type='text'>
This prevents the constants from moving.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This prevents the constants from moving.
</pre>
</div>
</content>
</entry>
<entry>
<title>Add `GC.compact` again.</title>
<updated>2019-04-20T01:19:47+00:00</updated>
<author>
<name>tenderlove</name>
<email>tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e</email>
</author>
<published>2019-04-20T01:19:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=91793b8967e0531bd1159a8ff0cc7e50739c7620'/>
<id>91793b8967e0531bd1159a8ff0cc7e50739c7620</id>
<content type='text'>
🙏

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67620 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
🙏

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67620 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
</pre>
</div>
</content>
</entry>
</feed>
