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

49611 Коммитов

Автор SHA1 Сообщение Дата
k0kubun fb29cffab0 process.c: add :exception option to Kernel.#system
to raise error when it fails.

[Feature 14386] [GH-1795]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62025 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-24 14:11:25 +00:00
nobu 7184e03eb2 mkmf.rb: werror on mswin
* lib/mkmf.rb (MakeMakefile#try_ldflags): enable warning checking
  on mswin, link.exe warns -l options but does not fail.
  [Bug #13069]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62024 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-24 08:25:36 +00:00
nobu 6a3a7e9114 dir.c: Dir#each_child
* dir.c (dir_each_child_m): new instance methods Dir#each_child
  and Dir#children.  [Feature #13969]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62022 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-24 07:15:55 +00:00
nobu f7210deb82 NEWS: [Feature #14223] [ci skip]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62021 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-24 06:32:46 +00:00
nobu a6e5073c57 vm_args.c: to_proc refinements
* vm_args.c (vm_to_proc): enable #to_proc by refinements at Proc
  passing as a block.  patched by osyo (manga osyo).
  [Feature #14223]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62020 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-24 06:25:02 +00:00
yui-knk c786db207a Fix a typo
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62019 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-24 00:12:53 +00:00
kazu 49a23c27de Add documentation for the Kernel#warn :uplevel keyword
[ruby-core:84574] [Bug #14264]
Author:    Jeremy Evans <code@jeremyevans.net>

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62018 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-24 00:03:51 +00:00
nobu a41005eb6a init.c: encode socket error message
* ext/socket/init.c (rsock_raise_socket_error): on Windows, encode
  error messages from wide characters to the default encodings.
  [ruby-core:84972] [Bug #14384]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62017 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-23 15:31:22 +00:00
svn d6aa4916b8 * 2018-01-24
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62016 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-23 15:31:22 +00:00
nobu fb6c4ca168 getaddrinfo.c: ai_errlist
* ext/socket/getaddrinfo.c (ai_errlist): used only if gai_strerror
  is missing.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62015 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-23 15:31:21 +00:00
nobu 813a206d56 parse.y: fix yytokentype function declarations
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62014 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-23 14:17:25 +00:00
nobu 502d0bab51 parse.y: added implicit parser_params argument
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62013 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-23 03:53:34 +00:00
nobu 8563942ad9 parse.y: added new_strterm wrapper
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62012 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-23 03:37:21 +00:00
nobu 63c047f10a parse.y: concat dedented heredoc
* parse.y (heredoc_dedent): concat literal strings after dedented.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62011 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-23 02:31:42 +00:00
svn c16c30ac1d * 2018-01-23
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62010 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-23 02:23:19 +00:00
nobu 2bf8cac208 parse.y: removed implicit parser_params macros
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62009 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-23 02:23:18 +00:00
kazu b8cc476ce9 use predefined IDs
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62008 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-22 13:09:37 +00:00
nobu 4f03a239dc mkmf.rb: ignore linker warnings
* lib/mkmf.rb (try_ldflags): ignore linker warnings.  they cause
  unexpected failures on OpenBSD.  [ruby-core:78827] [Bug #13069]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62007 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-22 12:34:51 +00:00
normal 218b8324bb time.c (num_exact): use predefined IDs
No need to waste space on "to_r" and "to_int" which are
predefined in defs/id.def

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62006 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-22 03:04:26 +00:00
normal 8a6c76b510 time.c: constify compat_* tables
compat_common_month_table and compat_leap_month_table should
not be writable.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62005 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-22 00:40:11 +00:00
svn 96240fa422 * 2018-01-22
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62004 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-21 15:26:20 +00:00
nobu c91b8a1b3d parse.y: expand tokp macro
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62003 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-21 15:26:20 +00:00
nobu 3cefccb6f9 parse.y: add EXPR_NONE
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62002 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-21 15:26:19 +00:00
nobu 415c334092 keywords: shrink struct kwtable
* defs/keywords (struct kwtable): shrink since members do not
  exceed 16bit.  lex_state needs to be int (or enum lex_state_e)
  when EXPR_MAX_STATE reaches it.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62001 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-21 09:59:45 +00:00
nobu 543ed3652f parse.y: fix state after left brace
* parse.y (parser_yylex): as well as `tLBRACE_ARG` (expr block),
  `tLBRACE` (primary block) also does not accept a label.  only
  hash brace accepts a label.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62000 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-21 07:44:25 +00:00
nobu 3a12eb82b2 parse.y: revert trace message to lex_state
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61999 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-21 07:44:24 +00:00
nobu bb5772de26 parse.y: use enum yytokentype
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61998 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-21 07:44:24 +00:00
nobu 46e2fad66a parse.y: parser_token_value_print for yydebug
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61997 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-21 07:44:23 +00:00
kazu f56a90ae89 Fix missing m4_include at r61982
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61996 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-21 02:24:26 +00:00
normal 903b6628de load.c: use rb_warning directly
This removes the last dependency on rb_mWarning outside of
error.c and allows future commits to mark it static.

Yes, I expect this to slow down the emitting of a warning
message in a cold code path slightly :P

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61995 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-20 22:07:36 +00:00
mame 8a489a7d6f ext/ripper/tools/dsl.rb: Use String#sub instead of delete_suffix
It fails when baseruby is old.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61994 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-20 17:52:51 +00:00
mame f69bf70881 parse.y: Remove unneeded macro nd_set_line
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61993 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-20 17:52:50 +00:00
mame 5db2894229 parse.y: Remove double meaning of new_qcall/new_command_qcall
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61992 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-20 17:45:25 +00:00
mame d24f1fddd7 ext/ripper/tools/dsl.rb: Serialize dispatch calls
To avoid the unspecified behavior (the evaluation order of arguments).
In `$$ = foo(bar(), baz());`, it is unspecified which `bar` or `baz` is
called earlier.

This commit changes the code to `v1=bar(); v2=baz(); $$ = foo();`.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61991 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-20 17:45:24 +00:00
mame 7ba7a2f70e parse.y: rewrite excessed_comma process
Currently, parser.y includes core parser and Ripper parser obscurity.
In addition, *some* Ripper code uses the result of the core parser,
which make it difficult to separate the two parsers.

I want to simplify this, not by separating the two parsers, but by
making *all* Ripper actions follows the core parser actions.
In other words, all the core parser actions run always even in Ripper,
and after that, Ripper-specific actions run.

For tha sake, in principle, I want to put `/*% ripper: ... %*/` in the
end of actions.
Anyway, it is too dirty to put it within expressions, IMO.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61990 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-20 16:21:29 +00:00
mame 43aa218de3 parse.y: Remove macros that are no longer used
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61989 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-20 16:21:28 +00:00
mame 57deb6fe18 parse.y: Remove double meaning of new_op_assign, etc.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61988 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-20 16:21:26 +00:00
mame 4d7b8af1cd parse.y: Remove double meaning of new_xstring/new_string1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61987 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-20 16:21:25 +00:00
mame a2688019e5 parse.y: remove double meaning of new_brace_body/new_do_body
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61986 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-20 16:21:23 +00:00
svn 4b90242278 * 2018-01-21
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61985 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-20 16:21:21 +00:00
mame c4c135cb7e parse.y: remove double meaning of const_path_field/top_const_field
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61984 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-20 16:21:20 +00:00
shyouhei 5839396028 Emacs friendliness [ci skip]
Just add comment by:
sed -i $'1i\\\n# -*- Autoconf -*-' tool/m4/*.m4

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61983 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-20 07:14:59 +00:00
shyouhei ec43478f34 set AC_CONFIG_MACRO_DIRS [close GH-1793]
We do not use aclocal(1) by default. But in case users do so,
AC_CONFIG_MACRO_DIRS help them reconstruct the same contents as
this commit includes.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61982 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-20 07:05:26 +00:00
shyouhei 0664a6377a refactor split configure.ac into files
This does not (yet) change anything. The generated configure file
is the identical to previous one (except several empty lines added
and deleted).

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61981 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-20 07:05:25 +00:00
nobu 645e441c32 Makefile.sub: missing/nan.obj
* win32/Makefile.sub (MISSING): nan() is available since msvcrr120.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61980 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-20 06:49:30 +00:00
mame 9e95513781 parse.y: Remove unneeded var_field_1 trick
I thought this trick was needed because the result of var_field was
passed to different arguments, as follows:

```
$1 = var_field(p, $1);
$$ = backref_assign_error(p, $1, $1, &@$);
```

Currently the DSL supports that one result is passed to one argument.

However, after the refactoring, I found that `backref_assign_error`
uses only one `$1`.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61979 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-20 06:11:21 +00:00
nobu a8a4bdb72e parse.y: dot_or_colon as id
* parse.y (dot_or_colon): made type of `dot_or_colon` and EXPR_DOT
  tokens to <id> and set those IDs at tokenization.  type cast at
  primary in ripper is no longer needed.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61978 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-20 05:58:06 +00:00
nobu 7efe4e0881 parse.y: moved excessed_comma
* parse.y (block_param): embed excessed_comma event result in
  place of rest argument, instead of dispatching with the whole
  parameters.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61977 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-20 05:47:59 +00:00
nobu 0b8594209d dsl.rb: p
* ext/ripper/tools/dsl.rb (DSL#initialize): define `p` for `struct
  parser_params *p`.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61976 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-20 05:39:03 +00:00
nobu b5be3e7893 dsl.rb: ID constants
* ext/ripper/tools/dsl.rb (DSL#method_missing): expand ID
  constnats without parentheses.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61975 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-20 05:39:02 +00:00