aboutsummaryrefslogtreecommitdiffstats
path: root/sample
Commit message (Collapse)AuthorAgeFilesLines
* * parse.y (new_yield): distinguish "yield 1,2" and "yield [1,2]".matz2003-06-201-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | [ruby-dev:20360] * eval.c (rb_eval): support new_yield() change. * variable.c (rb_const_get_0): warn for Foo::BAR when BAR is a toplevel constant (i.e. a constant defined under Object). [ruby-list:36935] * parse.y (no_blockarg): separate no block argument check and ret_args argument processing. * range.c (rb_range_beg_len): out_of_range check after adjusting end point. [ruby-dev:20370] * parse.y (call_args): the first argument to arg_cancat() should be NODE_LIST. [ruby-core:01151] * eval.c (rb_eval): should dispatch based on ID type. * eval.c (rb_yield_0): should restore scope_vmode during yield. [ruby-dev:20361] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3967 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (proc_alloc): re-unification of Block and Proc. Blockmatz2003-06-161-18/+16
| | | | | | | class is no longer available. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3948 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * sample/test.rb: add block to proc to avoid warning.eban2003-06-101-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3936 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y (value_expr0): class and module statements should not bematz2003-06-071-1/+1
| | | | | | | | | | | | | | | | | warned for "void value expression". [ruby-talk:72989] * gc.c (add_final): should determine type by respond_to? * gc.c (define_final): ditto. * io.c (rb_io_ctl): should not depend on respond_to? * range.c (range_step): rb_check_string_type(). * process.c (proc_setgroups): new functions. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3918 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * win32/win32.c (_CRTIMP): redefine _CRTIMP on MinGW.eban2003-05-291-2/+2
| | | | | | | | * configure.in: remove '-D__USE_CRTIMP' from XCFLAGS on MinGW. * win32/win32.c (NtMakeCmdVector): handle quotes only if not instring. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3877 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (Init_Proc): Block/Proc separation. [huge change]matz2003-05-261-6/+96
| | | | | | | | | | | | | | * eval.c (block_arity): returns exact arity number for Procs out of methods. also gives 1 for {|a|..}. * string.c (rb_str_match): revert use of String#index for invocation like string =~ string. * eval.c (rb_Array): move Object#to_a exclusion hack from splat_value(). need to be in eval.c for a while. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3867 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * error.c (rb_sys_fail): should not specify errno explicitly.matz2003-05-211-3/+0
| | | | | | | [ruby-dev:20264] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3847 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (rb_yield_0): give warning for multiple values for amatz2003-05-201-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | block parameter. * eval.c (rb_yield_values): a function to yield multiple values. * array.c (sort_1): use rb_yield_values. * enum.c (min_ii, max_ii): ditto. * hash.c (rb_hash_update_block_i, delete_if_i, select_i, each_pair_i, env_each, env_reject_bang, env_select, env_update_i): ditto. * struct.c (rb_struct_each_pair): ditto. * eval.c (top_include): should include module in the current self, not ruby_top_self. [ruby-dev:20198] * eval.c (top_include): stop inclusion to ruby_wrapper; give warning. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3833 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/pty/pty.c (pty_finalize_syswait): join (using Thread#value)matz2003-05-191-0/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | before detach pid. [ruby-talk:71519] * eval.c (PUSH_FRAME): save outer ruby_block. [ruby-list:37677], [ruby-dev:20202] * eval.c (BEGIN_CALLARGS): restore outer block by using ruby_block->outer. * eval.c (block_pass): do not alter block->prev, but block->outer. * array.c (get_inspect_tbl): warning on wrong condition. * eval.c (localjump_xvalue): renamed exitstatus to exit_value since it's not exit "status" after all. * eval.c (localjump_error): add reason to LocalJumpError. * compar.c (rb_cmpint): raise error via rb_cmperr(), if cmp value is nil. now take new 2 arguments. * time.c (time_cmp): 2003-05-16 fix was incomplete. (ruby-bugs-ja:PR#458) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3823 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* use warn() instead of $stderr.puts().tadf2003-05-181-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3815 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * object.c (rb_class_allocate_instance): singleton class checkmatz2003-05-161-0/+7
| | | | | | | | | | moved to rb_obj_alloc(). (ruby-bugs-ja PR#345) * re.c (rb_reg_quote): should escape white space characters, \t, \f, \n, \r. (ruby-bugs-ja PR#231) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3811 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* use values_at instead of select.tadf2003-05-052-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/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: svn+ssh://ci.ruby-lang.org/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: svn+ssh://ci.ruby-lang.org/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: svn+ssh://ci.ruby-lang.org/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: svn+ssh://ci.ruby-lang.org/ruby/trunk@3677 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * sample/test.rb: NaN comparison test.nobu2003-04-111-0/+22
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3672 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * sample/exyacc.rb: use Regexp in gsub!.akr2003-04-051-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/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: svn+ssh://ci.ruby-lang.org/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: svn+ssh://ci.ruby-lang.org/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: svn+ssh://ci.ruby-lang.org/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: svn+ssh://ci.ruby-lang.org/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: svn+ssh://ci.ruby-lang.org/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: svn+ssh://ci.ruby-lang.org/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: svn+ssh://ci.ruby-lang.org/ruby/trunk@3495 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* *** empty log message ***nobu2003-02-131-0/+7
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/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: svn+ssh://ci.ruby-lang.org/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: svn+ssh://ci.ruby-lang.org/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: svn+ssh://ci.ruby-lang.org/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: svn+ssh://ci.ruby-lang.org/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: svn+ssh://ci.ruby-lang.org/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: svn+ssh://ci.ruby-lang.org/ruby/trunk@3269 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Improve.knu2002-12-196-23/+13
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3186 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Be consistent on the use of the implicit $_.knu2002-12-191-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3185 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Improve.knu2002-12-192-11/+9
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3184 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Fix a bug.knu2002-12-191-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3183 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* The use of $_ and ~/RE/ is discouraged.knu2002-12-191-2/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3182 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Strive to give better examples.knu2002-12-193-18/+20
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/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: svn+ssh://ci.ruby-lang.org/ruby/trunk@3053 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ditto.nobu2002-10-021-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2926 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * sample/mkproto.rb: ditto and fix bug.eban2002-07-261-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/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: svn+ssh://ci.ruby-lang.org/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: svn+ssh://ci.ruby-lang.org/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: svn+ssh://ci.ruby-lang.org/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: svn+ssh://ci.ruby-lang.org/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: svn+ssh://ci.ruby-lang.org/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: svn+ssh://ci.ruby-lang.org/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: svn+ssh://ci.ruby-lang.org/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: svn+ssh://ci.ruby-lang.org/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: svn+ssh://ci.ruby-lang.org/ruby/trunk@2464 b2dd03c8-39d4-4d8f-98ff-823fe69b080e