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

54412 Коммитов

Автор SHA1 Сообщение Дата
svn d4f7fac6b8 * expand tabs.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67267 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-15 05:19:58 +00:00
mame c36a6f97f2 node.h: introduce nd_brace to determine if a hash literal is a keyword
NODE_HASH#nd_brace is a flag that is 1 for `foo({ k: 1 })` and 0 for
`foo(k: 1)`.
nd_alen had been abused for the flag (and the implementation is
completely the same), but an explicit name is better to read.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67266 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-15 05:19:54 +00:00
nobu 560bb32fb2 NEWS: adjust indents and escape brackets not to be labeled lists
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67265 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-15 01:19:31 +00:00
nobu 3134b20a01 Show the source line at an invalid class/instance variable
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67264 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-15 00:44:51 +00:00
svn bf4bcaf061 * 2019-03-15
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67262 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-14 22:43:59 +00:00
nagachika 9e7f197c8e tool/make-snapshot: Use 6-spaces indent for SIZE and digests
to align with release note markdown.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67261 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-14 22:43:57 +00:00
k0kubun 4d6e202977 Skip Bundler's test made fail by r67226
Possible fix would be https://github.com/bundler/bundler/pull/7038,
but Ruby script ending with `^~~` could be wrongly stripped by that?

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67257 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-14 13:47:10 +00:00
mame 3db2041f87 compile.c: fix the corner case of rest and keyword arguments
See https://bugs.ruby-lang.org/issues/10856#note-20 . [Bug #10856]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67256 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-14 09:04:57 +00:00
mame 146bb252a0 compile.c (setup_args): process arguments forward
For unknown reason, setup_args processed the arguments from the last to
the first.  This is not only difficult to read, but also inefficient in
some cases.  For example, the arguments of `foo(*a1, *a2, *a3)` was
compiled like `a1.dup << (a2.dup << a3)`.  The second dup (`a2.dup`) is
not needed.

This change refactors the function so that it processes the arguments
forward: `foo(*a1, *a2, *a3)` is compiled as `a1.dup << a2 << a3`, and
in my opinion, the source code is now much more readable.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67255 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-14 08:43:51 +00:00
nobu 9800fc26b0 parse.y: no punctuation instance/class variables
* parse.y (parse_atmark): exclude punctuation follows @ marks,
  whereas it is inclusive after $ mark as some punctuation global
  variables exist.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67254 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-14 08:13:46 +00:00
svn 277af37b42 * expand tabs.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67253 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-14 06:43:54 +00:00
mame 4c41dc8945 compile.c: factor out "compile_args" from "compile_array"
compile_array function had three usages: array literal, hash literal,
and method arguments. I think the third is completely different than the
first and second.  For example, method arguments and popped are
meaningless; keywords_ptr and flag parameter for array/hash literal is
also unused.

This change refactors them: a function "compile_args" is created for the
third, and removes no longer used parameters of "compile_array".

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67252 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-14 06:43:50 +00:00
nobu 9c077bbed9 parse.y: show invalid global variable line
* parse.y (parse_gvar): show the source line erred by invalid
  global variable, and indicate the variable including the wrong
  punctuation.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67251 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-14 05:57:42 +00:00
nobu ccc933d4a6 Hoisted out ruby_show_error_line
* parse.y (ruby_show_error_line): hoisted out from parser_yyerror.

* parse.y (regx_options): revert r67226 and show the error line
  separately.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67250 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-14 05:32:30 +00:00
nobu 86c5806c6a More initializations of YYLTYPE
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67249 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-14 02:18:05 +00:00
svn e20aa14a82 * 2019-03-14
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67248 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-14 01:04:55 +00:00
mame 6a860ea006 Guard out the test when it is run under root permission
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67247 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-14 01:04:53 +00:00
svn 0d6910dfc8 * 2019-03-13
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67244 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-13 01:44:45 +00:00
nobu 8415df619e Remove unnecessary local variable
newline is always "\n" when it is used.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67243 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-13 01:44:34 +00:00
nobu 8952525a8e Assertion for r67226
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67227 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-12 12:04:03 +00:00
nobu b6468b01f7 Show unkwon regexp option line
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67226 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-12 04:23:17 +00:00
svn 60bddf589f * 2019-03-12
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67225 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-12 04:11:51 +00:00
nobu e5d10cda07 Flush erred token
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67224 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-12 04:11:41 +00:00
naruse a3a1199f41 fix wrong merge of conflict at r67217
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67221 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-11 13:00:31 +00:00
svn 43ff4ef912 * expand tabs.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67218 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-11 12:48:34 +00:00
mame 76fc1ce0a7 The combination of non-Symbol keys and Symbol keys is now allowed again
Revert r64358.  [Bug #15658]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67217 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-11 12:48:33 +00:00
nobu bda6df356a parse.y: moved excessed_comma
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67216 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-11 12:47:02 +00:00
hsbt bc76d8a232 Removed from standard library. No one maintains it from Ruby 2.0.0.
[Bug #15652][ruby-core:91736]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67215 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-11 11:37:17 +00:00
hsbt 098ec6eb50 Added to check MJIT constant for the Ruby 2.3-2.5.
This commit picked from 2c13beca2c

  Co-authored-by: Colby Swandale <me@colby.fyi>

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67214 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-11 10:09:48 +00:00
knu 448262c81d Mention the addition of Enumerator::Yielder#to_proc in NEWS
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67213 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-11 09:52:40 +00:00
hsbt 7d3d8e79fe fall back to copy + unlink on EPERM
[Feature #15415][ruby-core:90536]

  Co-authored-by: Eric Wong  <normalperson@yhbt.net>

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67212 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-11 09:52:31 +00:00
knu c2d3b8dfb4 Implement Enumerator::Yielder#to_proc
A Yielder object can now be directly passed to another method as a
block argument.

```ruby
enum = Enumerator.new { |y|
  Dir.glob("*.rb") { |file|
    File.open(file) { |f| f.each_line(&y) }
  }
}
```

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67211 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-11 09:49:14 +00:00
nobu 7d9664953b Removed circular require
Import rubygems/rubygems#2679

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67206 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-11 03:53:33 +00:00
nobu aef24ecbe9 Renamed duplicate test
Import rubygems/rubygems#2678

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67205 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-11 03:53:31 +00:00
svn 53f2cda8d4 * 2019-03-11
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67204 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-11 01:37:21 +00:00
nobu e5f01dab9d numeric.c: fix infinite loop
* numeric.c (int_pow): fix infinite loop in the case of y equal 1
  and power of x does not overflow.
  [ruby-core:91734] [Bug #15651]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67203 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-11 01:37:16 +00:00
svn f399c2912b * 2019-03-10
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67202 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-10 06:46:36 +00:00
nobu ffec546b0e eval.c: clear internal errinfo
* eval.c (ruby_cleanup): clear internal error info when invoking
  end procs.  [ruby-core:91731] [Bug #15650]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67201 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-10 06:46:28 +00:00
nobu 72df0a8e47 Add ignored_sp event
* ext/ripper/lib/ripper/lexer.rb (Ripper::Lexer): add ignored_sp
  event which will be fired from Ripper::Lexer#on_heredoc_dedent
  method.  [ruby-core:91727] [Bug #15648]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67200 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-09 10:17:33 +00:00
nobu 8776a09d4e Use assert_respond_to
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67199 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-09 10:14:16 +00:00
svn 28f619e301 * expand tabs.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67198 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-09 00:12:53 +00:00
nobu 5aecf03ec3 variable.c: hoisted out rb_namespace_p
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67197 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-09 00:12:52 +00:00
svn 5cfa518406 * 2019-03-09
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67196 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-09 00:00:35 +00:00
nobu d577019746 Early return in gc_mark_children
for types Float, Bignum and Symbol as they do not have references
and singleton classes.

[Fix GH-2091]

From: Lourens Naudé <lourens@bearmetal.eu>

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67195 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-09 00:00:26 +00:00
svn caa2a5bb0e * 2019-03-08
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67194 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-08 00:35:56 +00:00
tadd e185c9716e use __GNUC__ instead of __GCC__.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67193 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-08 00:35:53 +00:00
hsbt 4c1952f4bf Ignore to handle the different platform
When `GEM_HOME` was shared with CRuby and JRuby. RubyGems try to
  handle both platforms. It should be ignored the different platform.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67190 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-07 11:24:48 +00:00
svn 8cc5304408 * 2019-03-07
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67189 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-07 05:11:55 +00:00
nobu 23488589b3 io.c: chomp CR at the end of read buffer
* io.c (rb_io_getline_fast): chomp CR followed by LF but separated
  by the read buffer boundary.  [ruby-core:91707] [Bug #15642]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67188 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-07 05:11:46 +00:00
nobu 1598b5e7b3 Symbol creation is not a problem now unless pinned down
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67187 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-06 11:49:53 +00:00