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

856 Коммитов

Автор SHA1 Сообщение Дата
matz 276fb7e77b * compile.c (iseq_compile_each): should consider block on stack,
if block argument is passed.  [ruby-core:30534]

* parse.c (arg_concat_gen): should append to nd_head, not to
  nd_iter for NODE_BLOCK_PASS.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28123 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-06-02 03:05:06 +00:00
nobu 5d394118ff * parse.y (parser_tokadd_utf8, parser_tokadd_string): allow NUL
containing symbol literals, as well as String#to_sym.
  [ruby-dev:41447]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28084 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-29 18:40:48 +00:00
nobu bf36feb76d * parse.y (warn_balanced, parser_yylex): no warnings after closing
parens.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27991 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-24 10:00:36 +00:00
nobu 39f09ca13f * parse.y (warn_balanced): no warning for singleton class.
[ruby-core:30366]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27966 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-23 08:40:36 +00:00
mame 3cd67ce505 * parse.y (parser_read_escape, parser_tokadd_escape): allow a hex or
octal encoded character after \c.  This seemed to be prohibited at
  r13836, but its ChangeLog mentions nothing about this prohibition.
  So I assume this prohibition is not intended.  [ruby-core:27229]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27847 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-16 12:54:37 +00:00
nobu 8939436f24 * parse.y (warn_balanced): do not warn for EXPR_ENDFN.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27521 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-28 00:43:27 +00:00
nobu 422efe5352 * parse.y (parser_read_escape): deny extra character escapes.
[ruby-core:27228]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27507 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-27 01:54:23 +00:00
mame 56a18860da * parse.y (program): check void_expr when rb_parse_in_main().
[ruby-dev:38717]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27504 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-26 15:09:26 +00:00
nobu b0018f6859 * parse.y (ripper_get_value): escape Qundef.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27499 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-26 04:11:59 +00:00
nobu 3cbb849bbb * parse.y (warn_balanced): warn according to last state.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27498 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-26 03:42:45 +00:00
nobu 36f8540a2b * parse.y (warn_balanced): removed false warning.
* parse.y (parser_yylex): skip whitespaces after method name.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27436 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-22 07:43:33 +00:00
nobu 2976ec58a4 * parse.y (regexp): check each fragments. [ruby-core:27374]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27431 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-21 04:44:58 +00:00
nobu 82ba40b434 * parse.y (parser_yylex): reverted r27388 due to backward
compatibility.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27430 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-21 04:36:05 +00:00
nobu 2e1efa9499 * parse.y (parser_yylex): warn confusing binary operators after
local variable.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27429 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-21 03:15:49 +00:00
nobu f8e51f7e59 * parse.y (parser_yylex): abandoned EXPR_VCALL.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27427 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-21 02:31:40 +00:00
nobu f0f87d6eeb * parse.y (parser_yylex): fix for tLPAREN_ARG.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27417 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-20 10:25:52 +00:00
nobu e63df53198 * parse.y (lex_state_e, IS_END, IS_SPCARG, parser_yylex): separate
the state after vcall.  [ruby-core:29578]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27414 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-20 03:24:59 +00:00
nobu 85cb4ee236 * parse.y (parser_yylex): simplified with IS_ARG and IS_END.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27413 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-20 03:09:57 +00:00
nobu 04247ab5b4 * parse.y (parser_yylex): reduced duplicated conditions.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27399 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-19 10:18:56 +00:00
nobu f25e99c55f * parse.y (IS_END, IS_SPCARG): macros for simplification.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27392 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-18 13:16:30 +00:00
nobu 9f8b036123 * parse.y (string_content): cond_stack and cmdarg_stack are VALUE.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27391 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-18 13:13:23 +00:00
nobu e70a308c75 * parse.y (parser_yylex): seems like a symbol-literal when spaces
are unbalanced.  [ruby-core:29578]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27388 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-18 03:48:54 +00:00
nobu cfab29b7db * parse.y (string_content): preserve cond_stack and cmdarg_stack.
[ruby-core:29579]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27387 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-18 03:32:06 +00:00
mame fd9c3fef0b * parse.y (string_content, etc): counts of CMDARG_PUSH and POP were
inconsistent.  [ruby-core:22637]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27359 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-16 12:57:28 +00:00
nobu 83b8f94f4e * parse.y (rb_intern3): get rid of type-punning cast.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26967 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-17 19:41:00 +00:00
mame 4f78e7fff4 * parse.y (rb_intern3): prohibit Symbol with an invalid encoding.
[ruby-core:24621]

* test/ruby/test_m17n_comb.rb: modify a test for above.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26957 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-16 16:26:04 +00:00
mame 6b438bee04 * parse.y (top_compstmt, top_stmts, top_stmt): prohibit BEGIN {} in
non-toplevel scope.  [ruby-core:21657]

* test/ruby/test_beginendblock.rb (test_begininclass): add a test for
  above.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26347 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-01-18 16:43:29 +00:00
nobu 770b05dd9b * parse.y (dyna_pop_gen): pop dvars. [ruby-dev:39861]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26055 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-12-09 16:12:57 +00:00
nobu 9ad065375f * parse.y (k_def): adjust the location of method definition to the
line of def.  [Bug #2427]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25992 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-12-04 07:50:15 +00:00
nobu 8f6cdd7927 * parse.y (dyna_push_gen, dyna_pop_gen): no needs to save both of
args and vars.  [ruby-core:26961]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25969 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-12-01 03:01:15 +00:00
nobu 79446bfb70 * parse.y (dyna_push_gen): use rb_node_newnode() for ripper.
[ruby-core:26961]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25968 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-11-30 21:51:08 +00:00
nobu 9b02e165d3 * parse.y (dyna_push_gen, dyna_pop_gen): adjust local vtable level
for the case of syntax errors in method name or argument inside
  do block.   [ruby-core:26961]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25967 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-11-30 21:16:31 +00:00
nobu b19b496248 * parse.y (parser_yylex): suppress an extra error message after
numeric literal without digits.  based on a patch from ujihisa .
  in [ruby-dev:39811].  [ruby-dev:39798]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25962 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-11-30 02:00:14 +00:00
nobu 746eb4a45b * parse.y (BEGIN): now local_push are local_pop are necessary in
ripper.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25653 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-11-04 22:47:33 +00:00
kazu ab77f00b04 * parse.y (ripper_filename): add Ripper#filename. [ruby-dev:37856] * test/ripper/test_filter.rb: add more tests.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25499 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-26 23:11:59 +00:00
nobu 6221d16ffb * parse.y (arg_prepend): removed. a patch from Mikhail T. in
[ruby-core:26217].


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25432 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-22 08:29:53 +00:00
nobu 7bf5211220 * parse.y (ripper_intern): enable literal optimization.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25407 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-20 06:38:03 +00:00
nobu e3e93bb53e * parse.y (method_call): dispatch symbols. a patch from Andy Keep in
[ruby-core:26169].  [ruby-core:26165]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25405 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-20 06:28:51 +00:00
nobu 14f13abb85 * parse.y (mlhs_basic): fixed handling splat in middle of mlhs. a
patch from Andy Keep in [ruby-core:26163]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25404 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-20 06:07:39 +00:00
nobu b907ee320d * parse.y (parser_here_document): dispatch delayed heredoc
contents.  based on a patch from Andy Keep in [ruby-core:24855].


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25402 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-20 05:50:53 +00:00
akr 7db062cdc0 * parse.y (is_special_global_name): add boundary check.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25391 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-18 10:19:45 +00:00
akr 859a985715 * parse.y (parser_yylex): fix token even after trailing under score.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25382 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-17 07:35:39 +00:00
nobu e5e49b3a27 * parse.y (rb_intern3): check symbol table overflow before generate
next id.  [ruby-core:26092]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25352 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-15 09:26:15 +00:00
nobu 37531934e6 * parse.y (rb_intern3): check symbol table overflow.
[ruby-core:26092]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25351 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-15 07:57:40 +00:00
nobu 475bdfee7c * parse.y (token_info_push, token_info_pop): reduced ifdefs.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25319 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-13 09:23:19 +00:00
nobu 525f6818fa * parse.y (parser_magic_comment): fixed normalization.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25318 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-13 09:20:59 +00:00
nobu 72ad8595f2 * parse.y (bv_decls, bvar): fix for block variables.
[ruby-dev:39423]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25209 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-03 13:14:19 +00:00
nobu b3525ae1e7 * parse.y (assignable_gen): parser_yyerror takes two arguments.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25201 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-02 19:34:28 +00:00
nobu a0f667c33e * parse.y (assignable_gen): get rid of macro collision.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25198 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-02 17:59:25 +00:00
nobu aec8a4b0a4 * parse.y (ripper_yylval_id, ripper_get_{id,value}): wrap ID by
NODE to track local variable assignment.

* parse.y (lvar_defined_gen, assignable_gen): enable local
  variable check.  [ruby-core:24923]

* parse.y (validate): use value only.

* test/ripper/test_parser_events.rb (test_local_variables): tests
  based on a patch from Magnus Holm in [ruby-core:25885].


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25187 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-02 11:37:44 +00:00