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

489 Коммитов

Автор SHA1 Сообщение Дата
aamine b0d8301744 * parse.y (f_arg, opt_f_block_arg): ripper should export VALUE.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11859 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-24 08:45:58 +00:00
matz 02c147f04e * parse.y (struct local_vars): remove unused nofree member from
struct.

* parse.y (parser_free): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11849 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-24 07:05:48 +00:00
aamine dfd5c685c1 * parse.y (program): remove useless assignment to reduce warning.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11846 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-24 06:51:59 +00:00
matz b2035db684 * parse.y (lambda): remove unused clause from the rule to stop
warning.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11845 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-24 06:48:05 +00:00
ko1 0fe72040e4 * parse.y, node.h, compile.c: change node tree structure. a purpose
of this change is to unify argument structure of method and block.
  this change prohibits duplicate block parameter name.
  new argument infromation:
  NODE_ARGS     [m: int, o: NODE_OPT_ARG, ->]
  NODE_ARGS_AUX [r: ID, b: ID, ->]
  NODE_ARGS_AUX [Pst: id, Plen: int, init: NODE*]
  optarg information:
  NODE_OPT_ARGS [idx, expr, ->]
* vm_macro.def: ditto.
* gc.c: ditto.
* iseq.c: ditto.
* compile.h: fix debug function name.
* test/ripper/test_scanner_events.rb: |_,_,foo| -> |_1,_2,foo|
* test/ruby/test_lambda.rb: disalbe test temporarily.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11840 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-24 02:07:05 +00:00
aamine 67c94cae96 * parse.y (lambda): add ripper event. This fixes bus error on "make test-all".
* ext/ripper/extconf.rb: do not stop build.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11815 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-23 03:25:26 +00:00
matz 606734f0b1 * parse.y: remove dyna_check_gen() prototype.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11814 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-23 03:16:57 +00:00
matz b83ed6d1bd * parse.y, compile.c, gc.c, insns.def, intern.h, iseq.c, node.h,
object.c, string.c, variable.c, vm_macro.def: revert private
  instance variable feature, which is postponed until next major
  release.

* marshal.c: TYPE_SYMBOL2 removed; MARSHAL_MINOR reverted back to
  8th version.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11813 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-23 02:49:41 +00:00
matz 163163afdf * parse.y (mrhs): need to append by arg_append().
[ruby-talk:239385]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11760 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-16 10:58:04 +00:00
matz 3e874eae07 * parse.y (struct local_vars): no need to warn out-of-scope
variables; remove dnames member from struct.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11718 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-13 23:44:26 +00:00
matz 66a26a2367 * parse.y: RVarmap no longer used as yytype; removed.
* parse.y (dyna_push_gen): no longer need return value.

* parse.y (dyna_pop_gen): no longer need argument.

* parse.y (local_push_gen): initialize nofree.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11717 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-13 23:41:44 +00:00
ko1 44aef0b53f * this commit is a result of refactoring. only renaming functions,
moving definitions place, add/remove prototypes, deleting
  unused variables and removing yarv.h.
  This commit doesn't change any behavior of ruby/vm.
* yarv.h, common.mk: remove yarv.h (contents are moved to yarvcore.h).
* error.c, eval_intern.h: include yarvcore.h instead yarv.h
* rename some functions:
  * debug.[ch]: debug_*() -> ruby_debug_*()
  * iseq.c: iseq_*() -> rb_iseq_*(), ruby_iseq_disasm()
  * iseq.c: node_name() -> ruby_node_name()
  * vm.c: yarv_check_redefinition_opt_method() ->
    rb_vm_check_redefinition_opt_method()
* some refactoring with checking -Wall.
* array.c: remove rb_ary_ptr() (unused) and remove unused
  local variables.
* object.c: add a prototype of rb_mod_module_exec().
* eval_intern.h (ruby_cref): set it inline.
* eval_load.c (rb_load), yarvcore.c: yarv_load() -> rb_load_internal().
* parse.y: add a prototype of rb_parse_in_eval() (in eval.c).
* process.c: add a prototype of rb_thread_stop_timer_thread() (in thread.c).
* thread.c: remove raw_gets() function (unused) and fix some format
  mismatch (format mismatchs have remained yet. this is todo).
* thread.c (rb_thread_wait_fd_rw): fix typo on label name.
* thread_pthread.ci: comment out codes with USE_THREAD_CACHE.
* vm.c (rb_svar, rb_backref_get, rb_backref_get,
  rb_lastline_get, rb_lastline_set) : moved from yarvcore.c.
* vm.c (yarv_init_redefined_flag): add a prototype and rename
  yarv_opt_method_table to vm_opt_method_table.
* vm.c (rb_thread_eval): moved from yarvcore.c.
* yarvcore.c: remove unused global variables and fix to use nsdr().



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11652 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-07 01:25:05 +00:00
ko1 42ce75cdff * compile.c, insns.def: remove (get|set)instancevariable2 and add a
operand is_local to (get|set)instancevariable.
* yarvtest/test_class.rb: add a test for class local instance variable.
* parse.y (rb_decompose_ivar2): remove unused variable oid.
* tool/insns2vm.rb: remove needless require.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11639 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-06 05:22:17 +00:00
matz 72f2d2a00d * parse.y (rb_compose_ivar2): function to create a new ivar2
symbol from a symbol and a class.  back-ported from matzruby.

* parse.y (rb_decompose_ivar2): reverse function of
  rb_compose_ivar2(). 

* marshal.c (w_symbol): support class local instance variables.

* marshal.c (r_object0): ditto.

* compile.c (defined_expr): ditto.

* compile.c (iseq_compile_each): ditto.

* insns.def: add two new instructions: getinstancevariable2 and
  setinstancevariable2.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11630 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-04 19:17:33 +00:00
nobu 205f310c29 * call_cfunc.ci, compile.c, compile.h, debug.h, eval.c,
eval_error.h, eval_jump.h, eval_load.c, eval_thread.c, gc.c,
  insnhelper.h, insns.def, iseq.c, main.c, numeric.c, parse.y,
  range.c, regenc.h, ruby.h, signal.c, thread.c, thread_win32.ci,
  vm.c, vm.h, vm_dump.c, vm_evalbody.ci, yarvcore.c, yarvcore.h:
  fixed indents and non-C90 comments.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11620 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-02 16:26:04 +00:00
matz 6e0fed271c * ruby.h (SYMBOL_P): make Symbol immediate again for performance.
* string.c: redesign symbol methods.

* parse.y (rb_id2str): store Strings for operator symbols.
  [ruby-dev:30235]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11615 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-02 13:19:44 +00:00
matz 0abfa1c532 * parse.y (assignable_gen): no need to generate NODE_CVDECL.
* compile.c (iseq_compile_each): no NODE_CVDECL.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11614 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-02 10:24:06 +00:00
ko1 a3e1b1ce7e * Merge YARV
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11439 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-12-31 15:02:22 +00:00
matz 862e723d03 * eval.c (svalue_to_avalue): need to splat but no error.
* eval.c: new macros - YIELD_CALL, YIELD_VALUES.

* eval.c (rb_yield_values): specify YIELD_VALUES.

* eval.c (rb_yield_0): use new macros.

* eval.c (proc_invoke): slightly modified to separate YIELD_CALL
  and YIELD_VALUES from YIELD_ARY_ARGS.

* object.c (Init_Object): add nil.to_splat => [].


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11284 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-11-06 10:27:59 +00:00
matz 6d32246b31 * parse.y (arg_dup_check): vid may be nameless internal id.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11280 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-11-06 06:37:40 +00:00
nobu c85347f8b1 * parse.y (parser_yylex): use particular enums. [ruby-core:09221]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11183 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-10-17 15:56:28 +00:00
matz c6effd0182 * parse.y (singleton): no need to re-create NODE_SELF() again.
[ruby-core:09177]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11172 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-10-14 14:46:16 +00:00
matz 41f3f0eb66 * parse.y (parser_warning, parser_warn): some error message may
contain format specifiers.  a patch from Akinori MUSHA <knu at
  iDaemons.org>.  [ruby-dev:29657]

* regparse.c (onig_rb_warning, onig_rb_warn): ditto.

* ext/bigdecimal/bigdecimal.c (VpException): ditto.

* ext/dl/handle.c (rb_dlhandle_initialize): ditto.

* ext/gdbm/gdbm.c (rb_gdbm_fatal): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11170 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-10-14 14:33:10 +00:00
matz 2d09685150 * eval.c (rb_yield_0): small refactoring.
* parse.y (bparam_item): fixed bugs in handling parenthesized LHS.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11096 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-10-05 22:32:04 +00:00
matz ffedafffba * parse.y (block_param): should interpret single parenthesized
left hand side expression.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11079 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-10-04 07:17:16 +00:00
matz c4e5ec23d3 * parse.y (block_param): restrict block parameters to be local
variables only.

* test/ruby/test_iterator.rb (TestIterator::test_nested_iterator):
  update test suite to conform the last change.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11075 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-10-03 15:59:45 +00:00
matz eebdfca0b2 * parse.y (mlhs): simplifies the rule a bit.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11074 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-10-03 15:58:17 +00:00
matz c8d3d9ed3d * parse.y (dyna_in_block): inline using macro.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11072 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-10-03 15:09:12 +00:00
matz 5cc2093ccd * hash.c (recursive_hash): remove unused local variable.
* parse.y (parser_yylex): ditto.

* parse.y (rb_gc_mark_symbols): fix unmatched prototype .

* file.c (rb_get_path): check NUL byte in the path string.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11018 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-09-25 05:57:37 +00:00
matz 23d2c8b624 * string.c (rb_str_intern): raise SecurityError only when $SAFE
level is greater than zero.  [ruby-core:08862]

* parse.y (rb_interned_p): new function to check if a string is
  already interned.

* string.c (str_to_id): use rb_str_intern().


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10932 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-09-14 07:27:14 +00:00
matz 301c9f1265 * parse.y (symbols_i): need to initialize early-created symbols.
[ruby-dev:29496]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10871 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-09-06 04:25:53 +00:00
matz 9e0a2170fd * parse.y (rb_id2sym): intern if id is attrset_id.
[ruby-dev:29420] [ruby-dev:29447]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10849 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-09-04 05:57:35 +00:00
matz ccf5372b25 * object.c (Init_Object): move symbol related code to string.c
* string.c (Init_String): Symbol as subclass of String.

* parse.y (rb_intern2): handle symbol as strings.

* string.c (str_new): substring of symbols are mere strings, not
  symbols.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10834 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-09-02 15:05:27 +00:00
matz 8581164ea6 * eval.c (rb_eval): should handle when in else clause. a patch
from Eric Hodel <drbrain at segment7.net>.  [ruby-core:08662]

* parse.y (primary): wrap with NODE_CASE.  [ruby-core:08663]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10832 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-09-02 14:36:22 +00:00
matz 54af80844f * ruby.h (struct RString): embed small strings.
(RSTRING_LEN): defined for accessing string members.
  (RSTRING_PTR): ditto.

* string.c: use RSTRING_LEN and RSTRING_PTR.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10810 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-08-31 10:47:44 +00:00
drbrain 657b626899 Revert.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10793 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-08-28 02:33:04 +00:00
drbrain 6e83a71d3b Include attribution
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10789 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-08-27 23:03:20 +00:00
nobu 41066ad0b7 * parse.y (arg): allow newlines before ternary colon. [ruby-dev:29189]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10703 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-08-08 03:28:58 +00:00
matz 92077ee687 * parse.y (top_local_setup): local_vars[-1] should point
ruby_scope itself to protect local_tbl from garbage collection.
  [ruby-dev:29049]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10689 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-08-07 03:36:52 +00:00
matz ead9b197be * parse.y (f_args): allow post mandatory arguments after optional
arguments.  [ruby-dev:29014]

* parse.y (new_args_gen): allow post_args without rest_args.

* eval.c (formal_assign): ditto.

* parse.y (new_args_gen): check post argument duplication.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10516 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-07-12 11:10:22 +00:00
matz 672549bb47 * eval.c (proc_invoke): should not overwrite block information in
current frame.  [ruby-dev:28957]

* eval.c (rb_yield_0): retrieve proper block object from the frame
  record.

* eval.c (proc_alloc): return preserved block object if it's
  available.

* st.h (st_data_t): use pointer sized integer for st_data_t.
  [ruby-dev:28988]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10497 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-07-10 01:08:15 +00:00
matz 4df2cb8053 * parse.y: use ARGSPUSH instead of ARGSCAT to prevent too much
splat expansion.

* eval.c (when_check): need to handle ARGSPUSH as well.

* eval.c (block_orphan): lambda and proc from method are always
  orphan.

* gc.c (gc_mark_children): proper marking for NODE_BLOCK_PASS and
  NODE_LAMBDA.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10431 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-29 14:05:40 +00:00
matz b6630a375d * parse.y (primary): remove meaningless else-only case statement
syntax.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10418 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-28 00:23:57 +00:00
matz e5f2b421c0 * ext/socket/socket.c (sock_accept): revert to avoid ambiguity of
argument evaluation order.  [ruby-dev:28861]

* ext/socket/socket.c (sock_accept_nonblock): ditto.

* io.c (pipe_open): avoid closing uninitialized file descriptors.
  a patch from <tommy at tmtm.org> [ruby-dev:28600]

* parse.y: replace terminal token names with more descriptive
  name, i.e. kEND to keyword_end.  [ruby-list:42477]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10397 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-26 14:15:49 +00:00
akr 6143716587 * parse.y (paren_args): wrap $2 by escape_Qundef because it may be
Qundef.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10385 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-25 08:45:44 +00:00
matz 2ca2a4a43b * parse.y (block_param): do not use multiple assignment for a sole
block parameter.  [ruby-dev:28710]

* eval.c (rb_yield_0): pass a raw yielded value to a sole block
  parameter if a value is passed by yield.

* eval.c (proc_invoke): args may not be an array.

* eval.c (rb_proc_yield): pass original value without wrapping
  it in an array.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10356 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-21 08:08:36 +00:00
matz 7b5d9d7086 * parse.y (method_call): remove (fn)(args) style lambda
invocation, add fn.(args) instead.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10354 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-21 05:13:48 +00:00
nobu e394fed724 * parse.y (reswords): modifier token is no longer returned in fname
state.  fixed: [ruby-dev:28775]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10348 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-20 16:40:35 +00:00
matz 7b48490222 * eval.c (Init_eval): add aliases invoke_method and
invoke_functional_method corresponding send and funcall
  respectively.  [ruby-talk:197512]

* parse.y (parser_yylex): returns the most typical keyword token
  on EXPR_FNAME.  [ruby-core:7995]

* ext/socket/socket.c: protoize.

* parse.y (then): remove ':' from 'then' and 'do' rules.

* hash.c (env_aset): raise TypeError on nil with more descriptive
  message.  [ruby-core:07990]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10304 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-17 14:50:04 +00:00
nobu 9d07029049 * parse.y (reswords): kDO_BLOCK was missing. fixed: [ruby-core:7995]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10281 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-16 15:24:40 +00:00