summaryrefslogtreecommitdiff
path: root/eval.c
AgeCommit message (Collapse)Author
2002-09-27* eval.c (rb_eval): Class#inherited should be called after thematz
execution of the class body. * parse.y (primary): remove "return outside of method" check at compile time. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2897 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-09-26* regex.c (re_match): p1 may exceed pend limit.matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2891 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-09-25* io.c (appendline): forget to terminate with nul.matz
* eval.c (ruby_run): should set toplevel visibility again here. * eval.c (rb_eval): should not rely on ruby_class == rb_cObject check. Besides allow implicit publicity for attribute set methods. * parse.y (primary): need not to check class_nest, just set whether method is an attrset or not. * string.c (rb_str_each_line): p might be at the top of the string. * class.c (rb_make_metaclass): class of metaclass should be metaclass of superclass, unless class itself is a metaclass; class of metaclass of metaclass should point back to self. eh, confusing, isn't it. * class.c (rb_singleton_class): check if its class is singleton AND attached to self. * eval.c (rb_eval): should define class/module under ruby_cbase. * eval.c (rb_eval): should set class/module path based on ruby_cbase, not ruby_class. * eval.c (module_setup): use ruby_cbase instead of ruby_class. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2887 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-09-23* eval.c (rb_call0): must not clear ruby_current_node, ornobu
backtrace cannot be genetated. * intern.h (ruby_yyparse): rather than yyparse(). * parse.y (yylex): nextc() returns -1 at end of input, not 0. * parse.y (newline_node): reduce deplicated newline node. * parse.y (literal_concat): get rid of warning. * parse.y (new_evstr): fixed junk code. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2884 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-09-22* eval.c (call_trace_func): should not call trace function whilenobu
compilation. * eval.c (rb_call0): also inside c-func. * parse.y (yycompile): ditto. * ruby.c (require_libraries): preserve source file/line for each require. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2880 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-09-21* eval.c (rb_thread_raise): no need to save dead thread context.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2878 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-09-17move struct timeval to missing.hmichal
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2873 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-09-17* eval.c (rb_thread_die): put thread dead state.nobu
* eval.c (rb_thread_atfork): free stack buffer at fork too. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2872 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-09-17* eval.c (rb_mod_nesting): load wrapping module should appear inmatz
Module#nesting list. (ruby-bugs-ja:PR#328) * eval.c (rb_thread_remove): free stack buffer on remove. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2870 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-09-13* eval.c (rb_eval): avoid uninitialized global/class variablenobu
warnings at `||='. [ruby-dev:18278] * parse.y (stmt, arg): ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2862 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-09-11* eval.c (rb_trap_eval): preserve thread status and so on.nobu
[ruby-talk:40337], [ruby-core:00019] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2852 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-09-11* eval.c (proc_to_s): refined format. [ruby-dev:18215]nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2850 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-09-10* eval.c (rb_mod_define_method): initialize orig_func too.nobu
(ruby-bugs-ja:PR#330) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2838 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-09-05* eval.c (rb_eval): overriding false constant with class/modulenobu
definition should be error. (PR#327) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2796 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-08-29* array.c (rb_ary_become): should not free ptr if it's shared.matz
* eval.c (rb_alias): prohibit making an alias named "allocate" if klass is a metaclass. * string.c (rb_string_value_ptr): StringValuePtr() should never return NULL pointer. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2764 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-08-28Int vs Long cleanup #3 (ruby-core:352)michal
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2754 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-08-27* file.c (rb_find_file): $LOAD_PATH must not be empty.matz
* file.c (rb_find_file_ext): ditto. * range.c (range_eq): class check should be based on range.class, instead of Range to work with Range.dup. * range.c (range_eql): ditto. * class.c (rb_mod_dup): need to preserve metaclass and flags. * object.c (rb_cstr_to_dbl): had a buffer overrun. * marshal.c (w_class): integrate singleton check into a funciton to follow DRY principle. * marshal.c (w_uclass): should check singleton method. * object.c (rb_obj_dup): dmark and dfree functions must be match for T_DATA type. * object.c (rb_obj_dup): class of the duped object must be match to the class of the original. * re.c (rb_reg_quote): do not escape \t, \f, \r, \n, for they are not regular expression metacharacters. * time.c (time_s_alloc): use time_free instead of free (null check, also serves for type mark). * time.c (time_s_at): check dfree function too. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2748 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-08-24* eval.c (call_trace_func): restore source file/line, as tracenobu
function installed in required library with -r option can be called while parsing. (ruby-bugs:PR#372) * eval.c (module_setup): unused variable. [ruby-core:00358] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2743 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-08-23* eval.c (method_call): check receiver is defined.nobu
* eval.c (umethod_call): removed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2739 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-08-21*.c: Int vs Long cleanupmichal
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2734 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-08-21* eval.c (rb_thread_cleanup): should not modify the globalmatz
variable curr_thread. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2731 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-08-19particular symbol for win32_exception_list.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2719 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-08-19* eval.c (win32_get_exception_list, win32_set_exception_list): Cygwin fix.eban
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2718 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-08-19* eval.c (rb_thread_save_context, rb_thread_restore_context):nobu
save/restore SEH chain on MS-Windows at thread switch. [ruby-win32:273] * eval.c (win32_get_exception_frame, win32_set_exception_frame): added. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2716 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-08-15* eval.c (compile_error): must not clear ruby_sourcefile here.nobu
(ruby-bugs:PR#364). * eval.c (rb_longjmp): set ruby_sourcefile before making backtrace. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2710 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-08-15* eval.c (ruby_current_node) : added to set sourceline on demand.nobu
* eval.c (error_pos, error_print, rb_longjmp, assign): set source file/line. * eval.c (rb_eval): store current node instead of file/line, and preserve it at return. * eval.c (module_setup): ditto. * eval.c (struct thread): store node instead of file/line. * eval.c (rb_thread_raise): ditto. * intern.h (ruby_current_node): added. * intern.h (ruby_set_current_source): added. * parse.y (stmt, arg): not fix position of assignment. * parse.y (node_assign): ditto. * parse.y (yycompile): clear current node. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2709 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-08-12* bignum.c (rb_big_cmp): use dbl2big() for Floats, instead ofmatz
big2dbl(). * bignum.c (Init_Bignum): rb_big_zero_p() removed. There may be Bignum zero. * eval.c (rb_call0): new argument added for original method name. preserve original method name in frame->orig_func. * eval.c (is_defined): use frame->orig_func, not last_func. * eval.c (rb_eval): ditto. * eval.c (method_call): supply data->oid also to rb_call0(). * object.c (rb_class_allocate_instance): call rb_obj_alloc() when called from alias, thus invoke original "allocate". * eval.c (remove_method): removing allocate from classes should cause NameError. * hash.c (rb_hash_equal): should check default values. * ext/socket/socket.c (s_recvfrom): update RSTRING len. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2702 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-08-11* eval.c (rb_eval): set line number from all nodes.nobu
* eval.c (proc_to_s): show source file/line if available. * marshal.c (r_object): register TYPE_BIGNUM regardless real type. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-08-03* eval.c (rb_eval): set constant in cbase scope.nobu
* eval.c (assign): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2684 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-07-31* eval.c (rb_undef): undef should be done for klass, not ruby_class.matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2677 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-07-30* eval.c (rb_thread_join_m): add parameter type declaration.aamine
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2666 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-07-29* eval.c (localjump_error): add parameter type declaration.aamine
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2665 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-07-26* eval.c (rb_eval): no need to convert to string twice.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2660 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-07-26* random.c: replace with Mersenne Twister RNG.matz
* eval.c (jump_tag_but_local_jump): preserve retval in LocalJumpError exceptions. * parse.y (command): no more check for "super outside of method". * eval.c (rb_mod_define_method): should set last_class and last_func in the block->frame. * eval.c (error_handle): should handle TAG_THROW as well. * parse.y (yylex): new decimal notation '0d4567'. * parse.y (yylex): new octal notation '0o777'. * parse.y (string_content): every string_content node should return string only. use NODE_EVSTR to coercing. * eval.c (rb_eval): NODE_EVSTR support. * re.c (rb_reg_quote): avoid unnecessary string allocation. * string.c (get_pat): quote metachracters before compiling a string into a regex. * string.c (rb_str_split_m): special treatment of strings of size 1, but AWK emulation. now uses get_pat(). * string.c (rb_str_match_m): quote metacharacters. * string.c (rb_str_match2): ditto. * ext/socket/socket.c (sock_addrinfo): make all 3 versions of getaddrinfo happy. [ruby-core:00184] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2654 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-06-24* eval.c (rb_eval): NODE_EVSTR is no longer used.nobu
* eval.c (eval): not enforce to make assigned variables dynamic. * parse.y (string): split rules to strings/xstring/regexp to allow arbitrary statements inside string interpolation. * parse.y (here_document): splitted into three phases. * parse.y (literall_append, literal_concat): added. append/concatinate string literals. * sample/test.rb (valid_syntax): adjust line number for BEGIN. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2590 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-06-13* eval.c (svalue_to_avalue): v may be Qundef. This fix wasmatz
suggested by Guy Decoux. * hash.c (rb_hash_s_create): use rb_hash_aset() instead of calling st_insert() directly, to dup&freeze string keys. * parse.y (yylex): proper error message for "@@0". * parse.y (yylex): paren to parse_string() must be zero for unparenthesized strings. * parse.y (str_extend): broken string when unterminated "#{". * enum.c (enum_sort_by): had a bug in 1 element enumeration. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2565 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-06-11* eval.c (rb_eval): ruby_frame->last_func may be null, if it'smatz
called outside of a method. * parse.y (arg): use INT2NUM, not INT2FIX for tUMINUS. * parse.y (arg): unnecessary negative tPOW treatment. * parse.y (tokadd_escape): wrong backslash escapement. * parse.y (stmt,arg): too much void value check. * parse.y (stmt,arg): need to check void value on rules which does not use node_assign(). * ext/socket/socket.c (ipaddr): need not to taint hostnames. * range.c (range_include): should be based on "<=>", whereas member? still is based on "each". * range.c (range_min,range_max): redefine methods based on "<=>". git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2548 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-06-04* string.c (rb_str_aset): should raise error if an indexing stringmatz
is not found in the receiver. * sprintf.c (rb_f_sprintf): "%d" should convert objects into integers using Integer(). * lib/tempfile.rb (Tempfile::size): added. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2517 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-05-30* range.c (range_step): iteration done using "+" if elements arematz
Numeric. Otherwise using "succ". * range.c (range_each): iteration done using "succ". If the elements does not respond to "succ", raise TypeError. As a result, all Enumerable methods, e.g. collect, require elements to respond to "succ'. * range.c (range_member): comparison done using "each", if elements are non-Numeric or no-"succ" objects. Otherwise compare using "<=>". * range.c (Init_Range): remove "size" and "length". git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2506 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-05-29* parse.y: yyparse #defines moved from intern.hmatz
* ruby.c (proc_options): access prefixed "ruby_yydebug". * applied modifies to pacify some of gcc -Wall warnings. * parse.y (arg): no more ugly hack for "**", so that "-2**2" to be parsed as "(-2)**2", whereas "- 2**2" or "-(2)**2" to be parsed as "-(2**2)". * parse.y (yylex): '-2' to be literal fixnum. [new] * time.c (time_succ): new method for Range support. * time.c (time_arg): nil test against v[6] (usec). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2500 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-05-28 * array.c: fixed format string for 'long' args (%d -> %ld).michal
* class.c: ditto. * eval.c: ditto. * numeric.c: ditto. * pack.c: ditto. * parse.y: ditto. * range.c: ditto. * string.c: ditto. * util.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2498 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-05-28* eval.c (scope_node): trick to keep the node has a scope.nobu
* eval.c (rb_eval): NODE_EVSTR: write back local_tbl to the node. * eval.c (rb_eval): NODE_SCOPE: hold the scope node in ruby_scope. * eval.c (module_setup): ditto. * eval.c (rb_call0): ditto. * node.h (NEW_DASGN, NEW_DASGN_CURR): remove surplus semicolons. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2497 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-05-21* object.c (Init_Object): should do exact match for Module#==.matz
* compar.c (cmp_eq): returns 'false' if <=> returns 'nil'. * compar.c (cmp_gt,cmp_ge,cmp_lt,cmp_le,cmp_between): ditto. * pack.c (pack_pack): should propagate taintedness. * pack.c (pack_unpack): ditto. * eval.c (rb_thread_schedule): need to preserve errno before calling rb_trap_exec(). * regex.c (calculate_must_string): a bug in charset/charset_not parsing. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2482 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-05-16* eval.c (rb_thread_select): cleanup conditional compilation.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2460 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-05-14* eval.c (rb_clear_cache_by_class): new function.matz
* eval.c (set_method_visibility): should have clear cache forq updated visibility. * numeric.c (flo_to_s): default format precision to be "%.16g". * util.c (ruby_strtod): use own strtod(3) implementation to avoid locale hell. Due to this change "0xff".to_f no longer returns 255.0 * eval.c (avalue_to_yvalue): new function to distinguish yvalue (no-arg == Qundef) from svalue (no-arg == Qnil). * eval.c (rb_yield_0): use avalue_to_yvalue(). * eval.c (assign): warn if val == Qundef where it means rhs is void (e.g. yield without value or call without argument). * parse.y (value_expr): need not to warn for WHILE and UNTIL, since they can have return value (via valued break). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2457 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-05-09* eval.c (rb_thread_join): added an argument to limit time to waitnobu
the thread. * eval.c (rb_thread_join_m): new. and added optional argument. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2441 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-05-07* eval.c (rb_yield_0): The destination of the goto jump was wrong.aamine
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2436 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-05-07* eval.c (superclass): undesirable "unexpected return" when the superclass ↵aamine
is not a Class. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2435 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-05-01* numeric.c (num_step): better iteration condition for floatmatz
values; suggested by Masahiro TANAKA <masa@ir.isas.ac.jp>. * range.c (range_step): step (for Range#step method) <= 0 makes no sence, thus ArgError will be raised. * range.c (range_each): Range#each method is special case for Range#step(1) * file.c (rb_find_file): load must be done from an abolute path if $SAFE >= 4. * enum.c (enum_partition): new method. [new] * re.c (rb_reg_s_quote): quote whitespaces for /x cases. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2420 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-04-26* eval.c (rb_proc_new): make Proc from C function. [new]nobu
* intern.h (rb_proc_new): prototype. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2413 b2dd03c8-39d4-4d8f-98ff-823fe69b080e