summaryrefslogtreecommitdiffstats
path: root/eval.c
Commit message (Collapse)AuthorAgeFilesLines
* * eval.c (ruby_exec_node, ruby_run_node), ruby.c (process_options):nobu2008-04-121-12/+9
| | | | | | | | | | | | | | | | use iseq instead of NODE. * gc.c (source_filenames): removed. * include/ruby/intern.h, parse.y (yycompile, parser_mark, parser_free, ripper_initialize): rb_source_filename() is no longer used. * compile.c, compile.h (ERROR_ARGS), parse.y (node_newnode, fixpos, parser_warn, e_option_supplied, warn_unless_e_option, range_op, cond0): nd_file is no longer used. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15983 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (rb_f_loop): Mention StopIteration in the document.knu2008-04-101-0/+2
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15953 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/node.h: add new constants for rb_call()'s scope.matz2008-04-011-9/+6
| | | | | | | | | | * eval.c (iterate_method): use CALL_* scope constant to specify proper scope value. * eval.c (rb_each, rb_apply, rb_funcall, rb_funcall2, rb_funcall3): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15884 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (rb_obj_instance_eval): invalid comment syntax.nobu2008-03-211-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15820 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval_intern.h (rb_thread_raised_set): use generic flags.nobu2008-03-121-11/+4
| | | | | | | | | | | * eval.c (rb_longjmp): clear all raised flags. * eval.c (stack_check): leave clearing flag to rb_longjmp. * gc.c (rb_memerror): use thread raised flag instead of static flag. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15756 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (rb_f_local_variables): local_variables should return anmatz2008-03-101-1/+1
| | | | | | | | array of symbols. [ruby-dev:34008] * vm.c (collect_local_variables_in_env): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15741 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fix doc.akr2008-03-091-5/+5
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15734 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (stack_check): made flag per threads.nobu2008-02-281-7/+9
| | | | | | | * thread.c (rb_thread_set_raised, rb_thread_reset_raised): prefixed. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15625 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (rb_raise_jump): moved adjustment for control frame.nobu2008-02-191-3/+3
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15549 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (ruby_exec_node): no thread starts inside iseq compilation.nobu2008-02-191-3/+5
| | | | | | | | | * eval.c (rb_f_raise): skip current control frame. [ruby-core:15589] * insns.def (opt_div): raise as the ordinary method. [ruby-core:15589] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15544 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (eval): allow to eval in a binding that has a singleton method.mame2008-02-131-1/+1
| | | | | | | | | | | | [ruby-dev:33763] * test/ruby/test_proc.rb: add tests to achieve over 70% test coverage of time.c. * test/ruby/test_method.rb: ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15462 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (eval): check if backtrace is empty. [ruby-core:15040]nobu2008-01-141-4/+5
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15054 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * $Date$ keyword removed to avoid inclusion of locale dependentakr2008-01-061-1/+0
| | | | | | | string. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14912 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (Init_eval): move instance_eval and instance_exec tomatz2008-01-041-2/+2
| | | | | | | | BasicObject. [ruby-core:14747] * lib/delegate.rb: should preserve new methods in BasicObject. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14886 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * README.EXT.ja, dir.c, eval.c, eval_intern.h, lex.c.src,matz2007-12-251-5/+5
| | | | | | | | lex.c.blt, keywords, load.c, thread.c: more ANSI'ize. a patch from Tadashi Saito <shiba AT mail2.accsnet.ne.jp> in [ruby-dev:32725] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14655 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (rb_exc_raise): ANSI style.akr2007-12-241-9/+5
| | | | | | | | | | | | (rb_exc_fatal): ditto. (rb_raise_jump): ditto. (rb_jump_tag): ditto. (rb_block_given_p): ditto. * variable.c (original_module): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14596 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval_method.c (Init_eval_method): extracted from Init_evalakr2007-12-241-3/+1
| | | | | | | | | | for rdoc to find rb_mod_remove_method, rb_mod_undef_method and rb_mod_alias_method. * eval.c (Init_eval): call Init_eval_method. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14594 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (function_call_may_return_twice_jmp_buf): removed.akr2007-12-241-3/+0
| | | | | | | | (function_call_may_return_twice_false): removed. [ruby-core:14335] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14591 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* enable several rdoc.akr2007-12-241-2/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14584 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* enable documents for raise and local_variables.akr2007-12-231-4/+4
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14529 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (rb_obj_instance_eval): use class of immediate objects.ko12007-12-221-1/+1
| | | | | | | | * test/ruby/test_eval.rb: fix a test. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14457 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (rb_f_method_name): now __method__ and __callee__ arematz2007-12-221-30/+2
| | | | | | aliases. [ruby-core:14244] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14448 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * common.mk, *.ci: renamed to *.c.ko12007-12-201-4/+4
| | | | | | | | * eval_laod.c: renamed to load.c. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14364 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (errinfo_place): skip if error is Fixnum. [ruby-dev:32608]ko12007-12-191-1/+2
| | | | | | | | * bootstraptest/test_exception.rb, test_known_bug.rb: move fixed bug. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14323 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (rb_protect): restore root_jmpbuf even if proc exits byakr2007-12-131-3/+3
| | | | | | | break such as dbm.delete_if { break }. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14222 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (rb_protect): restore root_jmpbuf to avoid SEGV byakr2007-12-131-0/+3
| | | | | | | | 'IO.pipe; [].each.next' with gcc version 3.3.5 (Debian 1:3.3.5-13) on IA64. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14214 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * object.c (Init_Object): singleton_method_{added,removed,undefined}matz2007-12-111-1/+2
| | | | | | | | | hooks should be defined for BasicObject. [ruby-dev:32531] * eval.c (Init_eval): method_missing should be defined for all objects; moved to BasicObject. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14193 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (rb_method_missing): RDoc update patch from Hugh Sassematz2007-12-101-0/+3
| | | | | | <hgs AT dmu.ac.uk>. [ruby-core:12932] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14188 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (rb_f_public_send): rename invoke_method to public_send.matz2007-12-101-15/+7
| | | | | | it now invokes public method only no matter how it's called. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14173 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * insnhelper.ci (vm_yield_with_cfunc): fix to passing argc on thirdko12007-12-011-0/+6
| | | | | | | | | | | | | parameter of IFUNC. [ruby-dev:32329] * enumerator.c: fix to pass exact number of argument. * eval.c (rb_yield_values2): added. * include/ruby/ruby.h: ditto. * bootstraptest/test_knownbug.rb: move a fixed test. * bootstraptest/test_block.rb: ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14062 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * signal.c (trap_signm): SIGVTALRM no longer used for greenmatz2007-11-301-1/+1
| | | | | | | | | thread. [ruby-talk:281318] * signal.c (ruby_sig_finalize): do not install SIG_DFL handler if previous handler is sighandler(). git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14056 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (rb_method_missing): fix stack trace.ko12007-11-271-0/+2
| | | | | | | | | * bootstraptest/test_knownbug.rb: move solved tests. * bootstraptest/test_method.rb, test/ruby/test_regexp.rb: ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14026 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (eval): should be volatile value for GC.ko12007-11-091-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@13856 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (send_internal): use self in the previous frame to check fornobu2007-11-091-4/+10
| | | | | | | | | protected methods. [ruby-core:13254] * insnhelper.ci (vm_call_method): send! method has gone. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@13846 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (rb_invoke_method): check if invoked in function style.nobu2007-11-091-2/+2
| | | | | | | | | | | | | [ruby-core:13245] * insnhelper.ci (vm_call_cfunc, vm_cfunc_flags): stores and returns VM calling flags. * vm.c (rb_vm_cfunc_funcall_p): returns if the current method is invoked in function style. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@13844 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c: fix typo in invoke_method documentationdavidflanagan2007-11-061-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@13832 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (Init_eval): move #send to Kernel module from BasicObject.matz2007-11-051-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@13825 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (rb_f_send): allow send/__send__ to call methods of allmatz2007-11-041-24/+20
| | | | | | | | | | visibility again. we no longer provide __send, __send!. * eval.c (rb_invoke_method): new method to honor private visibility. if it's invoked in a function call style, it calls private methods as well (previous 1.9 send behavior). git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@13824 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (ruby_options), ruby.c (proc_options, process_options): notnobu2007-10-011-3/+10
| | | | | | | | | call exit(2) directly. [ruby-dev:31912] * eval.c (ruby_run_node): deal with direct exit code. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@13579 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/intern.h: export rb_ivar_foreach.akr2007-09-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * include/ruby/ruby.h: modify struct RObject and RClass for optimizing T_OBJECT space. [ruby-dev:31853] (ROBJECT_LEN, ROBJECT_PTR) (RCLASS_IV_TBL, RCLASS_M_TBL, RCLASS_SUPER, RCLASS_IV_INDEX_TBL) (RMODULE_IV_TBL, RMODULE_M_TBL, RMODULE_SUPER): abstract accessor defined. * variable.c: support the modified RObject and RClass. * object.c: ditto. * class.c: ditto. * gc.c: ditto. * marshal.c: ditto. * eval_method.ci: use the abstract accessor. * insns.def: ditto. * proc.c: ditto. * struct.c: ditto. * eval.c: ditto. * error.c: ditto. * vm.c: ditto. * insnhelper.ci: ditto. * ext/digest/digest.c: ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@13543 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (eval): fix to check stack overflow.ko12007-09-261-0/+1
| | | | | | | | * eval_intern.h, vm.h: move CHECK_STACK_OVERFLOW() macro. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@13521 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (rb_longjmp): source file information may be NULL.matz2007-09-251-4/+11
| | | | | | | | [ruby-dev:31849] * eval.c (ruby_finalize_0): clear trace_func before finalization. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@13510 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm.h, eval_intern.h: move some macros to eval_intern.h.ko12007-09-141-2/+0
| | | | | | | | | * eval_jump.ci (rb_f_throw): fix to use NEW_THROW_OBJECT(). * eval.c (rb_f_loop): remove additional macro. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@13441 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * encoding.c: provide basic features for M17N.matz2007-08-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * parse.y: encoding aware parsing. * parse.y (pragma_encoding): encoding specification pragma. * parse.y (rb_intern3): encoding specified symbols. * string.c (rb_str_length): length based on characters. for older behavior, bytesize method added. * string.c (rb_str_index_m): index based on characters. rindex as well. * string.c (succ_char): encoding aware succeeding string. * string.c (rb_str_reverse): reverse based on characters. * string.c (rb_str_inspect): encoding aware string description. * string.c (rb_str_upcase_bang): encoding aware case conversion. downcase, capitalize, swapcase as well. * string.c (rb_str_tr_bang): tr based on characters. delete, squeeze, tr_s, count as well. * string.c (rb_str_split_m): split based on characters. * string.c (rb_str_each_line): encoding aware each_line. * string.c (rb_str_each_char): added. iteration based on characters. * string.c (rb_str_strip_bang): encoding aware whitespace stripping. lstrip, rstrip as well. * string.c (rb_str_justify): encoding aware justifying (ljust, rjust, center). * string.c (str_encoding): get encoding attribute from a string. * re.c (rb_reg_initialize): encoding aware regular expression * sprintf.c (rb_str_format): formatting (i.e. length count) based on characters. * io.c (rb_io_getc): getc to return one-character string. for older behavior, getbyte method added. * ext/stringio/stringio.c (strio_getc): ditto. * io.c (rb_io_ungetc): allow pushing arbitrary string at the current reading point. * ext/stringio/stringio.c (strio_ungetc): ditto. * ext/strscan/strscan.c: encoding support. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@13261 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * enumerator.c (enumerator_next): stop pre-fetching.matz2007-08-241-3/+9
| | | | | | | | * enumerator.c (Init_Enumerator): remove next? method. * eval.c (rb_f_loop): now handles StopIteration exception. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@13245 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (rb_f_send_bang): abandon the name funcall for privatematz2007-08-241-11/+11
| | | | | | aware method call. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@13243 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c: $! should not be writable.ko12007-08-181-12/+42
| | | | | | | | | * eval.c (rb_rubylevel_errinfo): added. rb_errinfo() returns rb_threa_t#errinfo. rb_rubylevel_errinfo() returns $! value. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@13091 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (frame_func_id): return proper method ID.nobu2007-08-171-5/+12
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@13082 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (rb_call), eval_method.ci (rb_add_method, rb_alias),ko12007-08-171-15/+24
| | | | | | | | | | | insnhelper.ci (vm_call_method): fix to save safelevel for method node. * include/ruby/node.h: ditto. * bootstraptest/test_method.rb: add a test for above. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@13079 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * proc.c (Init_Proc), eval.c (Init_eval), eval_intern.h: moveko12007-08-141-1/+6
| | | | | | | | | | | | init place of exception_error. * inits.c: ditto. * eval.c (Init_eval): set exception_error#throwed_state as TAG_FATAL. [ruby-dev:31407] * bootstraptest/test_exception.rb: add a test for above. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@12930 b2dd03c8-39d4-4d8f-98ff-823fe69b080e