summaryrefslogtreecommitdiffstats
path: root/sample
Commit message (Collapse)AuthorAgeFilesLines
* use values_at instead of select.tadf2003-05-052-2/+2
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@3757 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * sample/test.rb: substitute 'select' with 'values_at'.eban2003-05-051-1/+1
| | | | | | | | * lib/date.rb: ditto. * lib/parsedate.rb: ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@3756 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * sample/test.rb: avoid the MSVCRT *printf problem(float).eban2003-04-201-2/+5
| | | | | | | [ruby-dev:20037] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@3704 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * struct.c (rb_struct_eql): should compare values with "eql?".matz2003-04-181-0/+10
| | | | | | | | | | | * range.c (range_check): <=> returns nil for invalid values; should check. * regex.c (re_compile_pattern): should not set RE_OPTIMIZE_ANCHOR, if anychar_repeat is enclosed by parentheses. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@3695 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * bignum.c (rb_cstr_to_inum, rb_big2str): allow 2-36 as radix.nobu2003-04-141-0/+6
| | | | | | | | | * numeric.c (rb_fix2str): ditto. * string.c (rb_str_to_i): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@3677 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * sample/test.rb: NaN comparison test.nobu2003-04-111-0/+22
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@3672 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * sample/exyacc.rb: use Regexp in gsub!.akr2003-04-051-2/+2
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@3644 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (assign): should prepare mrhs by svalue_to_mrhs().matz2003-04-041-0/+7
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@3642 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (avalue_splat): new function to do unary * (splat)matz2003-03-261-6/+28
| | | | | | | | | | | | | | | | | | | operator. * eval.c (avalue_to_svalue,svalue_to_avalue,svalue_to_mrhs): do not use implicit "to_ary" conversion. * ext/curses/curses.c (GetWINDOW,GetMOUSE): add taint check. * ext/curses/curses.c (curses_init_screen): ditto. * ext/curses/curses.c (window_initialize): ditto. * gc.c (os_each_obj): prohibit ObjectSpace#each_object in safe mode ($SAFE >= 4). git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@3616 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * signal.c (trap): return "DEFAULT" and "IGNORE" respectively formatz2003-03-251-0/+5
| | | | | | | previous sighandler SIG_DFL and SIG_IGN. [ruby-talk:67860] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@3614 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (massign): remove unnecessary array unpacking; it shouldmatz2003-03-101-0/+11
| | | | | | | | | | | | | | | | be handled before massign() by svalue_to_mrhs(). * eval.c (svalue_to_mrhs): '*a = v' value conversion to avalue (i.e. [1] => [[1]], [1,2] => [1,2]). * eval.c (rb_eval): use svalue_to_mrhs. * eval.c (rb_yield_0): ditto. * eval.c (proc_invoke): break from "Proc#yield" is legal. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@3573 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y (arg): parse 'lhs = a rescue b' as 'lhs=(a rescue b)'.matz2003-03-031-0/+1
| | | | | | | | * io.c (rb_io_fread): should not clearerr() if there's no filled buffer (i.e. rb_io_fread() returning zero). git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@3543 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (file_expand_path): buffer might be reallocated whilenobu2003-02-161-0/+8
| | | | | | | | | | | expanding default directory. * file.c (file_expand_path): default directory was being ignored if path was full path with no drive letter, under DOSISH. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@3497 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (file_expand_path): fix surplus path separators whilenobu2003-02-141-0/+13
| | | | | | | expanding at root directory. [ruby-dev:19572] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@3495 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* *** empty log message ***nobu2003-02-131-0/+7
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@3493 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * range.c (range_step): step might be float 0 < x < 1.matz2003-02-131-0/+14
| | | | | | | | * eval.c (rb_thread_schedule): pause if no runnable thread when there's only one thread. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@3492 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_equal): a == b is true when b is non T_ARRAYmatz2003-02-041-1/+1
| | | | | | | | | | | | | object, if b has "to_ary" and b == a. * hash.c (rb_hash_equal): a == b is true when b is non T_HASH object, if b has "to_hash" and b == a. * string.c (rb_str_equal): a == b is true when b is non T_STRING object, if b has "to_str" and b == a. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@3442 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * re.c (rb_memsearch): algolithm body of String#index.matz2003-02-031-1/+1
| | | | | | | | | | | | | | | | * error.c (Init_Exception): "to_str" removed. * eval.c (eval): should not rely on Exception#to_str * eval.c (compile_error): ditto. * error.c (err_append): ditto. * hash.c (rb_hash_merge): Hash#merge, non destructive "update". now there's also Hash#merge! which is an alias to "update". git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@3431 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * regex.c (is_in_list): should work weill with UTF-8.matz2003-01-201-0/+1
| | | | | | | * regex.c (re_match_exec): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@3363 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * hash.c (env_clear): new Hash compatible method.matz2003-01-071-48/+252
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * hash.c (env_shift): ditto. * hash.c (env_invert): ditto. * hash.c (env_replace): ditto. * hash.c (env_update): ditto. * array.c (rb_ary_join): dispatch based on "to_str". * array.c (rb_ary_times): ditto. * array.c (rb_ary_equal): ditto. * process.c (rb_f_exec): dispatch based on "to_ary". * eval.c (umethod_bind): exact class match is not required. relax the restriction to subclasses. * eval.c (rb_eval): call "inherited" before executing class body. * class.c (rb_define_class): call "inherited" after defining the constant. * class.c (rb_define_class_under): ditto. * eval.c (massign): expand first element if RHS is an array and its size is 1, and LHS has concrete assignment target (i.e. LHS has target(s) other than *var). * eval.c (massign): avoid unnecessary avalue/svalue conversion. * eval.c (rb_yield_0): ditto * array.c (rb_ary_update): do not allocate unused array if rpl is nil (i.e. merely removing elements). * io.c (io_read): should resize supplied string if it's shorter than expected. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@3307 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (massign): removed awkward conversion between yvalue,matz2003-01-011-88/+77
| | | | | | | | | | | | | mvalue, etc. * eval.c (rb_yield_0): new parameter added to tell whether val is an array value or not. * parse.y (yield_args): restructuring: new nodes: NODE_RESTARY2, NODE_SVALUE; removed node: NODE_RESTARGS. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@3269 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Improve.knu2002-12-196-23/+13
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@3186 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Be consistent on the use of the implicit $_.knu2002-12-191-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@3185 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Improve.knu2002-12-192-11/+9
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@3184 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Fix a bug.knu2002-12-191-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@3183 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* The use of $_ and ~/RE/ is discouraged.knu2002-12-191-2/+4
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@3182 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Strive to give better examples.knu2002-12-193-18/+20
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@3181 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * bin/irb: Moved from sample/irb.rb.knu2002-11-181-21/+0
| | | | | | | | * instruby.rb: Install script files under bin/ with ruby's program prefix and suffix. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@3053 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ditto.nobu2002-10-021-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@2926 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * sample/mkproto.rb: ditto and fix bug.eban2002-07-261-2/+2
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@2658 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_slice_bang): if there's no correspondingmatz2002-07-112-3/+3
| | | | | | | | | | | | | | | | | | | | substring, slice! should return nil without exception. * array.c (rb_ary_insert): type fixed. * string.c (rb_str_split_m): accept separator value nil as well. * string.c (rb_str_become): was leaking memory. * class.c (rb_include_module): should not alter other classes/modules by inclusion. by this fix, local order may not be preserved for some cases. * class.c (include_class_new): module may be T_ICLASS; retrieve original module information. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@2632 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * re.c (rb_reg_expr_str): need to process backslashes properly.matz2002-06-282-3/+2
| | | | | | | | | | | | | | | | | | * object.c (rb_any_to_a): declare Object#to_a to be obsolete. * object.c (rb_Array): do not convert nil into [] automagically. * object.c (rb_Integer): use "to_int" instead of "to_i". [experimental] * object.c (nil_to_f): new method. * object.c (rb_Integer): Symbols and nil should cause error. * object.c (rb_Float): nil should cause error. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@2608 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (rb_eval): NODE_EVSTR is no longer used.nobu2002-06-241-1/+1
| | | | | | | | | | | | | | | | | * 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: http://svn.ruby-lang.org/repos/ruby/trunk@2590 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* updated to the new version (based on date2 3.3).tadf2002-06-222-12/+12
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@2589 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ext/exmk.rb.in, lib/singleton.rb: remove nested ""s.matz2002-06-131-3/+4
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@2566 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (rb_eval): ruby_frame->last_func may be null, if it'smatz2002-06-111-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | 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: http://svn.ruby-lang.org/repos/ruby/trunk@2548 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * sample/biorhythm.rb (getPosiiton,etc)H_Konishi2002-06-061-1/+2
| | | | | | | fix at changing Date module ( Date is changed Fixnum to Rational ) git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@2530 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* updated to the new version (based on date2 3.2.1).tadf2002-05-182-5/+5
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@2467 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * sampl/test.rb: use eval instead of './miniruby -c',eban2002-05-171-2/+9
| | | | | | | in order to check a syntax error. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@2464 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (rb_clear_cache_by_class): new function.matz2002-05-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | * 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: http://svn.ruby-lang.org/repos/ruby/trunk@2457 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * re.c (rb_reg_search): should clear last_match if pos is out ofmatz2002-03-191-0/+12
| | | | | | | | | | | | | | | string range. * string.c (rb_str_index_m): ditto. * string.c (rb_str_rindex): ditto. * class.c (rb_define_class): should handle autoload. * class.c (rb_define_module): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@2225 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * regex.c (re_compile_pattern): '\0111' should be '\011' plus '1',matz2002-03-121-11/+0
| | | | | | | | | | | | | | | | | | | | | | | | | since octal literals are formed by three digits at most. * marshal.c (w_object): module inclusion using extend() should also be detected. * eval.c (rb_eval_cmd): cbase should not be NULL; it should be either ruby_wrapper or Object. * enum.c (enum_each_with_index): should return self. * process.c (proc_setpgrp): should return value for non-void function. * process.c (proc_getpgid): should raise exception if getpgid() return -1. * string.c (rb_str_ljust): should return a duplicated string. * string.c (rb_str_rjust): ditto. * string.c (rb_str_center): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@2187 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (cvar_cbase): utility function to find innermost nonmatz2002-03-081-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | singleton cbase. * eval.c (is_defined): adopt new cvar behavior. * eval.c (rb_eval): ditto. * eval.c (assign): ditto. * class.c (rb_mod_clone): should not call rb_obj_clone(), since Module does not provide "allocate". * class.c (rb_singleton_class): should crate new singleton class if obj is a class or module and attached object is different, which means metaclass of singleton class is sought. * time.c (time_s_alloc): now follows allocation framework. * eval.c (rb_eval): should initialize outer class variables from methods in singleton class definitions. * eval.c (assign): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@2169 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* commit miss.nobu2002-02-251-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@2133 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * sample/test.rb (system): test with scripts under the sourcenobu2002-02-251-1/+6
| | | | | | | directory. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@2132 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (path_check_1): do not warn on world writable *parent*matz2002-02-191-0/+8
| | | | | | | | | | directories. * class.c (rb_include_module): should preserve ancestor order in the included class/module. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@2094 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (rb_eval_string_wrap): should hide the toplevel localmatz2002-02-191-297/+0
| | | | | | | variable bindings by PUSH_SCOPE(). git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@2089 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * bignum.c (rb_big_rshift): should properly convert the nagativematz2002-02-151-0/+13
| | | | | | | value to 2's compliment. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@2072 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y (stmt): local variable declaration order was changedmatz2002-02-131-0/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | since 1.6 * parse.y (arg): ditto. * pack.c (pack_pack): add templates 'q' and 'Q'. * pack.c (pack_unpack): ditto. * bignum.c (rb_quad_pack): new utility function. * bignum.c (rb_quad_unpack): ditto. * parse.y (assignable): should emit CVASGN within the method body. * dir.c (dir_s_glob): should not warn even if no match found. * eval.c (rb_eval): clean up class variable behavior. * eval.c (assign): ditto. * eval.c (is_defined): ditto. * variable.c (rb_mod_class_variables): need not to call rb_cvar_singleton(). * variable.c (rb_cvar_singleton): removed. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@2063 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * st.c: primes should be primes.matz2002-01-161-4/+18
| | | | | | | | | | | | * eval.c (is_defined): method defined? check should honor protected too. * eval.c (block_pass): should not pass tainted block, if $SAFE > 0. * variable.c (rb_mod_remove_cvar): should pass the char*. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@1996 b2dd03c8-39d4-4d8f-98ff-823fe69b080e