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

957 Коммитов

Автор SHA1 Сообщение Дата
nobu fbacb71b38 [Feature #6693]
* parse.y (shadowing_lvar_gen, warn_unused_var): no warnings for
  variables starting with _.  [ruby-core:46160][Feature #6693]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36337 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-07 22:36:25 +00:00
nobu 64ae33a18a parse.y: fix GC problem of keyword rest argument
* parse.y (new_args_tail_gen): fix GC problem of keyword rest
  argument.  the wrapped struct should be bound to the wrapping node
  before assignment of child nodes, to get rid of the case the
  children are referred by only the struct pointer which is not a
  subject of GC.  [ruby-core:45744]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36161 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-21 08:20:51 +00:00
nobu 45f6cdcdd3 Bug #6403: reset states after empty args
* parse.y (f_arglist): should reset lexical states after empty
  argument list with no parenthesis as well as parenthesized list,
  so that reserved name method definition work.  [ruby-dev:45626]
  [Bug #6403]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35644 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-05-14 07:28:36 +00:00
nobu 4bbb0f9801 Bug #6419: fix cmdarg begin
* parse.y (primary): begin/end block should be isolated from outside.
  [ruby-dev:45631][Bug #6419]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35620 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-05-11 05:23:14 +00:00
nobu ae32e9a225 parse.y: debugging stuff
* parse.y (lex_state_name): returns name for lex_state_e, for debug
  use.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35607 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-05-10 01:18:27 +00:00
nobu 9cf2170e78 * parse.y (parser_yylex): allow spaces between lambda arrow and
parenthesis.  [ruby-dev:45605][Feature #6390]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35520 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-05-02 14:21:23 +00:00
nobu 3380974143 * parse.y (assoc, parser_yylex): add syntax to splat keyword hash.
[ruby-core:44591][Feature #6353]
* compile.c (compile_array_): generate keyword splat insns.
* vm.c (m_core_hash_merge_kwd): merge keyword hash into intermediate
  hash.  leftward argument is prior currently.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35489 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-28 21:12:05 +00:00
nobu 5f34227718 * parse.y (parser_yylex): EXPR_BEG by keywords is a start point of
commands.  [ruby-dev:45563][Bug #6347]
* parse.y (superclass): ditto for superclass.
* parse.y (parser_parse_string, parser_here_document): ditto for
  string interpolation.
* parse.y (parser_yylex): ditto for singleton class.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35457 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-24 07:04:41 +00:00
mame 563762f6c5 * parse.y (primary): remove wrong "fixpos" that caused incorrect
source_location of blocks.  [ruby-core:42232] [Bug #5930]

* test/ruby/test_proc.rb: add a test for above.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35447 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-23 15:23:41 +00:00
ko1 ee7f8d4805 * compile.c (compile_array, compile_array_):
Divide big array (or hash) literals into several blocks and
  concatetene them.  There was a problem that a big array (hash)
  literal causes SystemStackError exception (stack overflow)
  because VM push all contents of the literal onto VM stack to
  make an array (or hash).  To solve this issue, we make several
  arrays (hashes) and concatenate them to make a big array (hash)
  object.
  ??
* compile.c (iseq_compile_each, setup_args): use modified
  compile_array.
* vm.c (m_core_hash_from_ary, m_core_hash_merge_ary,
  m_core_hash_merge_ptr): added for above change.
* id.c (Init_id), parse.y: add core method ids.
* bootstraptest/test_literal.rb: add simple tests.
* bootstraptest/test_eval.rb: remove rescue clause to catch
  SystemStackError exception.
* test/ruby/test_literal.rb: add tests to check no stack overflow.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35306 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-12 01:33:34 +00:00
nobu db5265a82c * parse.y (rb_check_id_cstr): new function to check if ID is
registered with NUL-terminated C string.
* sprintf.c (rb_str_format): avoid inadvertent symbol creation.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35300 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-11 13:31:23 +00:00
nobu 41c199130a * parse.y (string_content, parser_yylex): count brace nesting to
dispatch embexpr_end.  [ruby-core:43775][Bug #6211]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35269 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-09 06:16:07 +00:00
nobu 7af3e9f08b fix unreachable warning line number
* parse.y (block_append_gen): fix unreachable warning line number.
  should warn at the code, not jump.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35068 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-16 08:42:16 +00:00
nobu bf87ec4eb9 * parse.y (parser_yylex): fix warning line number.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35038 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-15 06:37:46 +00:00
nobu 375aedbfb4 * parse.y (sym_check_asciionly): check ascii compatibility before
scanning for code range.
* parse.y (intern_str): set to us-ascii if ascii only.
  [ruby-dev:45363][Bug #6146]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35034 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-15 06:04:44 +00:00
nobu 08d81f2683 fix ripper
* parse.y (new_args_gen, new_args_tail_gen): fix ripper.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35000 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-13 15:26:03 +00:00
nobu 8fe3fb4c0f * compile.c (iseq_set_arguments): keyword rest arg without keyword args.
* node.c (dump_node): dump kw_rest_arg too.
* parse.y (block_param, f_arg): more kwrest patterns.
  [ruby-core:42455][Bug #5989]
* parse.y (new_args_gen): no extra kw_rest_arg if no keyword rest arg.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34999 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-13 13:00:17 +00:00
nobu d6a977f667 * parse.y (block_param, f_args): add rules for the case arguments
begin with kwrest.  [ruby-core:42455][Bug #5989]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34998 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-13 06:17:08 +00:00
nobu c5feeb9ac1 * node.h (NEW_YIELD), parse.y (new_yield_gen): array-values flags
has been already obsolete.  patch by Thomas Enebo.
  [ruby-core:41929][Bug #5847]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34984 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-12 05:56:57 +00:00
nobu bc6dde9420 * parse.y (parser_tokadd_string): escape simple regexp meta
character termninators.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34929 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-06 07:24:07 +00:00
nobu c46bdadb84 * parse.y (block_call): rules for block_call after block_call.
based on a patch by pasberth https://github.com/ruby/ruby/pull/102
  [ruby-dev:45308][Bug #6115]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34913 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-05 16:34:21 +00:00
nobu 45f3651d1c * parse.y (block_command, block_call): simplified rules.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34912 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-05 16:24:15 +00:00
nobu 68a16f9a2d * parse.y (parser_tokadd_string): regexp engine doesn't need
terminators to be escaped.  [ruby-core:40364][Bug #5484]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34896 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-04 14:21:13 +00:00
matz f3e1c29b24 * parse.y (opt_bv_decl): allow newline at the end. [ruby-dev:45292]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34835 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-27 14:47:02 +00:00
nobu 785521bd51 * parse.y (parser_tokadd_string): insert a backslash only if
quoted by single quotes.  [ruby-dev:45281] [Bug #6069]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34796 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-24 22:54:00 +00:00
nobu 45c6daeed7 * parse.y (parser_tokadd_string, parser_yylex): insert a backslash
if the next character is non-ascii.  [ruby-dev:45278] [Bug #6069]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34776 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-23 23:52:12 +00:00
mame 8107587039 * parse.y (debug_lines, coverage): set file path encoding for coverage
result.  [ruby-dev:44950]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34415 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-01 16:28:14 +00:00
nobu bb19bcf93e * parse.y (rb_intern3): split to registration check and new
registration.
* parse.y (rb_intern_str): make interned string shared with the
  given string.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34354 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-01-22 06:41:29 +00:00
nobu f1dc132b41 * parse.y (rb_intern3, rb_intern_str): check the coderange first.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34352 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-01-22 06:23:38 +00:00
nobu 731e45216a * node.h (rb_args_info): change pre_args_num and post_args_num as
int, to match with rb_iseq_t.
* parse.y (new_args_gen): check overflow.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34139 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-27 12:17:36 +00:00
mame 1ab3974b0e * node.h, node.c, parse.y: implement a parser part for keyword arguments. This is a preparation for keyword argument (see [ruby-core:40290]).
* gc.c (gc_mark_children): bookkeeping.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34135 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-26 14:20:03 +00:00
mame afb10c62c2 * node.h, parse.y (new_args_gen), compile.c (iseq_set_arguments): use struct rb_args_info instead of NODEs. This is a preparation for keyword argument (see [ruby-core:40290]).
* node.c (dump_node), gc.c (gc_mark_children, obj_free): bookkeeping.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34134 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-26 14:19:58 +00:00
mame 90b1afa310 * node.h, parse.y (lambda, f_larglist): remove NEW_LAMBDA hack. This is a preparation for keyword argument (see [ruby-core:40290]).
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34133 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-26 14:19:52 +00:00
nobu d62f56b041 * parse.y (primary): point method name line. [ruby-core:40936]
[Bug #5614]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34031 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-13 15:01:20 +00:00
nobu 0f9662f366 * parse.y (parser_magic_comment): should pass the proper value.
[ruby-dev:44984][Bug #5753]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34022 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-12 21:29:53 +00:00
shugo 900b4a6db6 * parse.y (stmt_or_begin): changed the error message for BEGIN not
at toplevel.  [ruby-dev:44963] [Bug #5738]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34016 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-12 13:43:56 +00:00
nobu b526738c3b * bignum.c (big_rshift), compile.c (validate_label,
iseq_build_from_ary_exception), cont.c (cont_capture), dir.c
  (dir_open_dir), gc.c (objspace_each_objects), io.c (pipe_open)
  (rb_io_advise), parse.y (parser_compile_string)
  (rb_parser_compile_file), proc.c (binding_free), process.c
  (rb_proc_exec_n, rb_seteuid_core, proc_setegid, rb_setegid_core)
  (p_uid_exchange, p_gid_exchange), regparse.c (strdup_with_null),
  signal.c (sig_dfl), vm.c (rb_iseq_eval, rb_iseq_eval_main),
  vm_insnhelper.c (vm_expandarray): suppress
  unused-but-set-variable warnings.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33951 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-05 09:57:00 +00:00
nobu 4659b00b9a * parse.y (nodetype, nodeline): suppress warnings.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33892 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-29 00:51:37 +00:00
usa 4d6de2f7c4 * parse.y (nodetype, nodeline): static. these functions are for
debugging, and not intend to be public.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33883 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-28 03:49:00 +00:00
naruse 615d5068d2 * parse.y (parser_nextc): set encoding for the buffer of ripper.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33542 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-28 02:30:22 +00:00
nobu 560a6c6ffa * ext/ripper/eventids2.c (ripper_init_eventids2): separate
initializations of IDs and objects.
* ext/ripper/tools/generate.rb (generate_eventids1): ditto.
* parse.y (Init_ripper, InitVM_ripper): fix inversed roles.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33474 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-18 14:05:51 +00:00
nobu 8e6e8e6288 * use RB_TYPE_P which is optimized for constant types, instead of
comparison with TYPE.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33357 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-29 11:07:45 +00:00
nobu c4d77cb4ad * parse.y (parser_data_type): inherit the core type in ripper so
that checks in core would work.  [ruby-core:39591] [Bug #5331]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33291 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-17 14:34:13 +00:00
nobu 4705fcc3c0 * README.EXT, README.EXT.ja (2.2.2), parse.y (rb_check_id): add
documents for rb_check_id().

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33255 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-12 04:38:15 +00:00
matz 6126c50add * parse.y (bv_decls): parse.y relies on $$ = $1 before action
routines.  a patch from Michael Edgar.  [Bug #5303]
  [ruby-core:39429]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33242 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-09 23:32:56 +00:00
nobu 5e14b97947 * parse.y (parser_tokadd_string, parser_yylex): ignore a backslash
which prefixes an non-ascii character, which has no escape
  syntax.  [ruby-core:39222] [Ruby 1.9 - Bug #5262]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33161 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-02 00:58:10 +00:00
nobu 3fbc65d47f * parse.y (rb_check_id): make the given name a symbol or a string.
based on the second patch by Jeremy Evans at [ruby-core:38447]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32684 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-26 16:05:27 +00:00
naruse 65658ea0d4 * parse.y (rb_enc_symname_type): :$a!, @a! and so on are not
valid symbols, so they should be inspected with quotes.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32639 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-23 10:03:30 +00:00
nobu 12d9be6b72 * parse.y (rb_check_id): take care of attrset ID created
implicitly by local ID.  [Bug #5084]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32635 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-23 03:19:07 +00:00
nobu d9242d5966 * parse.y (rb_check_id): conversion condition was inverse.
[Bug #5084]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32634 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-23 03:12:28 +00:00