Browse files

* compile.c, dir.c, eval.c, eval_jump.h, eval_method.h, numeric.c,

  pack.c, parse.y, re.c, thread.c, vm.c, vm_dump.c, call_cfunc.ci,
  thread_pthread.ci, thread_win32.ci: fixed indentation.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12431 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information...
1 parent f3dfa40 commit 99d65b14b4ec3a546a28b6b17b3b4553eaf27b2f @nobu nobu committed Jun 5, 2007
Showing with 2,261 additions and 2,230 deletions.
  1. +44 −32 ChangeLog
  2. +19 −19 call_cfunc.ci
  3. +1,639 −1,623 compile.c
  4. +6 −6 dir.c
  5. +90 −90 eval.c
  6. +23 −23 eval_jump.h
  7. +18 −18 eval_method.h
  8. +24 −24 numeric.c
  9. +25 −25 pack.c
  10. +16 −16 parse.y
  11. +145 −142 re.c
  12. +107 −107 thread.c
  13. +2 −2 thread_pthread.ci
  14. +7 −7 thread_win32.ci
  15. +3 −3 version.h
  16. +82 −82 vm.c
  17. +11 −11 vm_dump.c
View
76 ChangeLog
@@ -1,3 +1,15 @@
+Tue Jun 5 13:26:36 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * compile.c, dir.c, eval.c, eval_jump.h, eval_method.h, numeric.c,
+ pack.c, parse.y, re.c, thread.c, vm.c, vm_dump.c, call_cfunc.ci,
+ thread_pthread.ci, thread_win32.ci: fixed indentation.
+
+Tue Jun 5 13:17:11 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * call_cfunc.ci, compile.c, dir.c, eval.c, eval_jump.h, numeric.c,
+ pack.c, re.c, thread.c, thread_win32.ci, vm.c, vm_dump.c: fixed
+ indentation.
+
Mon Jun 04 21:15:45 2007 NARUSE, Yui <naruse@ruby-lang.org>
* lib/json.rb, lib/json, ext/json, test/json:
@@ -965,8 +977,8 @@ Wed Mar 21 17:04:30 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
Tue Mar 21 08:20:00 2007 Nathaniel Talbott <ntalbott@ruby-lang.org>
- * test/testunit/collector/test_dir.rb: Fixed test/unit tests that
- were breaking due to Module#public_instance_methods now
+ * test/testunit/collector/test_dir.rb: Fixed test/unit tests that
+ were breaking due to Module#public_instance_methods now
returning a Symbol instead of a String.
* test/testunit/collector/test_objectspace.rb: Ditto.
@@ -1256,14 +1268,14 @@ Fri Mar 2 21:17:14 2007 Masaki Suketa <masaki.suketa@nifty.ne.jp>
* ext/win32ole/win32ole.c (get_ptr_of_variant, ole_set_safe_array,
ole_val2ptr_variant, ole_val2olevariantdata, ole_variant2val,
- ): fix some bugs of WIN32OLE_VARIANT.new when variant type is
+ ): fix some bugs of WIN32OLE_VARIANT.new when variant type is
VT_ARRAY|VT_BSTR or VT_BYREF.
* ext/win32ole/win32ole.c (folevariant_s_array, folevariant_initialize):
WIN32OLE_VARIANT#[], WIN32OLE_VARIANT#[]=, WIN32OLE_VARIANT#value=
is defined as instance method of WIN32OLE_VARIANT.
- * test/win32ole/test_win32ole_variant.rb: add some test for
+ * test/win32ole/test_win32ole_variant.rb: add some test for
VT_ARRAY, VT_BYREF variant type.
Fri Mar 2 07:58:24 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
@@ -1642,7 +1654,7 @@ Sat Feb 24 10:38:05 2007 Minero Aoki <aamine@loveruby.net>
Sat Feb 24 07:31:35 2007 Masaki Suketa <masaki.suketa@nifty.ne.jp>
- * ext/win32ole/win32ole.c: add WIN32OLE_VARIANT.array,
+ * ext/win32ole/win32ole.c: add WIN32OLE_VARIANT.array,
WIN32OLE_VARIANT#value=, refactoring.
* test/win32ole/test_win32ole_variant.rb: add some test for
@@ -1757,7 +1769,7 @@ Wed Feb 21 09:14:04 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
Tue Feb 20 21:19:29 2007 Masaki Suketa <masaki.suketa@nifty.ne.jp>
- * ext/win32ole/win32ole.c (installed_code_page_proc,
+ * ext/win32ole/win32ole.c (installed_code_page_proc,
ole_variant2val): small refactoring.
Tue Feb 20 15:11:42 2007 Koichi Sasada <ko1@atdot.net>
@@ -1822,7 +1834,7 @@ Fri Feb 16 20:59:10 2007 Koichi Sasada <ko1@atdot.net>
Fri Feb 16 19:24:22 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
* math.c (math_log): update document to mention second optional
- argument for logarithm base.
+ argument for logarithm base.
Fri Feb 16 19:19:21 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
@@ -1872,7 +1884,7 @@ Thu Feb 15 01:43:45 2007 Koichi Sasada <ko1@atdot.net>
Wed Feb 14 22:52:43 2007 Masaki Suketa <masaki.suketa@nifty.ne.jp>
- * ext/win32ole/win32ole.c (ole_variant2val): VC++6 does not
+ * ext/win32ole/win32ole.c (ole_variant2val): VC++6 does not
support VT_I8, VT_UI8.
Wed Feb 14 22:10:21 2007 Koichi Sasada <ko1@atdot.net>
@@ -1998,7 +2010,7 @@ Sun Feb 11 22:10:08 2007 Kouhei Sutou <kou@cozmixng.org>
Sun Feb 11 18:47:14 2007 Masaki Suketa <masaki.suketa@nifty.ne.jp>
- * ext/win32ole/win32ole.c (ole_val2olevariantdata):
+ * ext/win32ole/win32ole.c (ole_val2olevariantdata):
WIN32OLE_VARIANT#new accepts nil when variant type is VT_ARRAY.
* test/win32ole/test_win32ole_variant.rb: ditto.
@@ -2026,7 +2038,7 @@ Sat Feb 10 17:46:52 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
Sat Feb 10 00:13:11 2007 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
- * ext/tk/lib/tk.rb: fix typo (TkConfigMethod::__confinfo_cmd,
+ * ext/tk/lib/tk.rb: fix typo (TkConfigMethod::__confinfo_cmd,
__conv_keyonly_opts).
Fri Feb 9 12:33:40 2007 Koichi Sasada <ko1@atdot.net>
@@ -2066,7 +2078,7 @@ Thu Feb 8 22:44:04 2007 Masaki Suketa <masaki.suketa@nifty.ne.jp>
* ext/win32ole/win32ole.c (ole_set_safe_array, ole_variant2val,
ole_val_ary2variant_ary): fix WIN32OLE_VARIANT.new bug when
- 1st argument is empty array, and when 2nd argument is
+ 1st argument is empty array, and when 2nd argument is
VT_ARRAY|VT_BYREF.
* test/win32ole/test_win32ole_variant.rb: ditto.
@@ -2123,7 +2135,7 @@ Thu Feb 8 15:48:44 2007 Koichi Sasada <ko1@atdot.net>
* thread.c: fix to use polling in select on cygwin and mswin32.
- * thread.c, thread_pthread.ci, thread_win32.ci, yarvcore.h:
+ * thread.c, thread_pthread.ci, thread_win32.ci, yarvcore.h:
rename:
* rb_thread_t#interrupt_function -> unblock_function
* rb_interrupt_function_t -> rb_unblock_function
@@ -2223,7 +2235,7 @@ Wed Feb 7 09:35:32 2007 Koichi Sasada <ko1@atdot.net>
* thread_pthread.ci: comment out codes with USE_THREAD_CACHE.
- * vm.c (rb_svar, rb_backref_get, rb_backref_get,
+ * 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
@@ -2409,7 +2421,7 @@ Sat Feb 3 23:51:58 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
symbol from a symbol and a class. back-ported from matzruby.
* parse.y (rb_decompose_ivar2): reverse function of
- rb_compose_ivar2().
+ rb_compose_ivar2().
* marshal.c (w_symbol): support class local instance variables.
@@ -2433,7 +2445,7 @@ Sat Feb 3 23:21:13 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
Sat Feb 3 14:32:58 2007 Masaki Suketa <masaki.suketa@nifty.ne.jp>
* ext/win32ole/win32ole.c (ole_val2olevariantdata, ole_val2variant):
- fix the bug of WIN32OLE_VARIANT.new when variant type is
+ fix the bug of WIN32OLE_VARIANT.new when variant type is
VT_ARRAY.
* ext/win32ole/sample/excel1.rb: rewrite using WIN32OLE_VARIANT.
@@ -2484,7 +2496,7 @@ Fri Feb 2 18:27:54 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
Fri Feb 2 00:13:44 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
- * ruby.h (SYMBOL_P): make Symbol immediate again for performance.
+ * ruby.h (SYMBOL_P): make Symbol immediate again for performance.
* string.c: redesign symbol methods.
@@ -2556,7 +2568,7 @@ Mon Jan 29 21:32:37 2007 Masaki Suketa <masaki.suketa@nifty.ne.jp>
* test/win32ole/test_win32ole.rb: add test for WIN32OLE.locale=,
WIN32OLE.locale.
- * test/win32ole/test_win32ole_variant.rb: add test for
+ * test/win32ole/test_win32ole_variant.rb: add test for
WIN32OLE_VARIANT#vartype.
Mon Jan 29 14:14:35 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
@@ -2570,11 +2582,11 @@ Sun Jan 28 08:41:49 2007 Masaki Suketa <masaki.suketa@nifty.ne.jp>
Sat Jan 27 18:36:33 2007 Masaki Suketa <masaki.suketa@nifty.ne.jp>
- * ext/win32ole/win32ole.c (ole_val2olevariantdata): bug fix.
+ * ext/win32ole/win32ole.c (ole_val2olevariantdata): bug fix.
WIN32OLE_VARIANT.new check that 1st argument should T_ARRAY
when variant type is VT_ARRAY.
- * test/win32ole/test_win32ole_variant.rb: add some test.
+ * test/win32ole/test_win32ole_variant.rb: add some test.
Fri Jan 26 23:55:56 2007 Masaki Suketa <masaki.suketa@nifty.ne.jp>
@@ -2629,14 +2641,14 @@ Mon Jan 22 14:57:25 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
Sat Jan 20 21:05:18 2007 Masaki Suketa <masaki.suketa@nifty.ne.jp>
- * ext/win32ole/win32ole.c (fole_s_set_code_page): WIN32OLE.codepage=
+ * ext/win32ole/win32ole.c (fole_s_set_code_page): WIN32OLE.codepage=
accepts installed codepage.
* test/win32ole/test_win32ole.rb (test_s_codepage_changed): ditto.
Sat Jan 20 11:18:49 2007 Masaki Suketa <masaki.suketa@nifty.ne.jp>
- * ext/win32ole/win32ole.c (ole_invoke, ole_invoke2, ole_propertyput):
+ * ext/win32ole/win32ole.c (ole_invoke, ole_invoke2, ole_propertyput):
modify WIN32OLERuntimeError message.
* test/win32ole/test_win32ole.rb: ditto.
@@ -2665,11 +2677,11 @@ Fri Jan 19 06:53:38 2007 Masaki Suketa <masaki.suketa@nifty.ne.jp>
* ext/win32ole/win32ole.c (olevariant_free): fix memory leak.
- * ext/win32ole/win32ole.c (ole_val2olevariantdata):
- WIN32OLE_VARIANT.new accepts nil as first argument for some VARIANT
+ * ext/win32ole/win32ole.c (ole_val2olevariantdata):
+ WIN32OLE_VARIANT.new accepts nil as first argument for some VARIANT
TYPE.
- * test/win32ole/test_win32ole_variant.rb: ditto.
+ * test/win32ole/test_win32ole_variant.rb: ditto.
Wed Jan 17 17:31:28 2007 Koichi Sasada <ko1@atdot.net>
@@ -2681,7 +2693,7 @@ Wed Jan 17 17:31:28 2007 Koichi Sasada <ko1@atdot.net>
* yarvcore.h, yarvcore.c: rename or remove some global variables
removed: mYarvCore, mYarvInsns
- renamed: cYarvISeq -> rb_cISeq,
+ renamed: cYarvISeq -> rb_cISeq,
cYarvProc -> rb_cProc, cYarvBinding -> rb_cBinding
::YarvCore module is removed and ::YarvCore::VM class becomes ::VM.
And change/remove some functions which added with YARV.
@@ -2733,8 +2745,8 @@ Tue Jan 16 12:00:06 2007 Koichi Sasada <ko1@atdot.net>
Sat Jan 13 23:24:59 2007 Masaki Suketa <masaki.suketa@nifty.ne.jp>
- * ext/win32ole/win32ole.c (ole_free, ole_type_free,
- olemethod_free, olevariable_free, oleparam_free,
+ * ext/win32ole/win32ole.c (ole_free, ole_type_free,
+ olemethod_free, olevariable_free, oleparam_free,
ole_event_free): fix memory leak. [ruby-core:09846]
Wed Jan 10 00:10:23 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
@@ -2783,7 +2795,7 @@ Sun Jan 7 17:47:16 2007 Masaki Suketa <masaki.suketa@nifty.ne.jp>
* ext/win32ole/win32ole.c: update comment for rdoc of
WIN32OLE#[] and WIN32OLE#[]=.
-Sun Jan 7 12:13:26 2007 Eric Hodel <drbrain@segment7.net>
+Sun Jan 7 12:13:26 2007 Eric Hodel <drbrain@segment7.net>
* lib/rdoc/parsers/parse_c.rb (RDoc::C_Parser#find_class_comment):
Look for class and module comments above rb_define_class and
@@ -2843,7 +2855,7 @@ Sat Jan 6 09:10:52 2007 Koichi Sasada <ko1@atdot.net>
Sat Jan 6 08:29:17 2007 Masaki Suketa <masaki.suketa@nifty.ne.jp>
- * ext/win32ole/win32ole.c (Init_win32ole): add
+ * ext/win32ole/win32ole.c (Init_win32ole): add
WIN32OLE::VARIANT::VT_EMPTY, WIN32OLE::VARIANT::VT_NULL
* test/win32ole/test_win32ole_variant_m.rb (test_variant): ditto.
@@ -2916,7 +2928,7 @@ Fri Jan 5 13:59:53 2007 Koichi Sasada <ko1@atdot.net>
Fri Jan 5 12:03:07 2007 Koichi Sasada <ko1@atdot.net>
- * compile.c (iseq_compile_each, set_block_local_tbl):
+ * compile.c (iseq_compile_each, set_block_local_tbl):
support NODE_LAMBDA (partly).
* sample/test.rb: restore test of NODE_LAMBDA
@@ -2961,7 +2973,7 @@ Thu Jan 4 16:57:14 2007 Koichi Sasada <ko1@atdot.net>
Thu Jan 4 17:00:06 2007 GOTOU Yuuzou <gotoyuzo@notwork.org>
* ext/openssl/ossl_asn1.c (Init_ossl_asn1):
- OpenSSL::ASN1::ASN1Data#value,#tag,#tag_class and
+ OpenSSL::ASN1::ASN1Data#value,#tag,#tag_class and
OpenSSL::ASN1::BitString#unused_bits should be public.
Thu Jan 04 13:45:10 2007 Koichi Sasada <ko1@atdot.net>
@@ -3093,7 +3105,7 @@ Wed Dec 27 10:04:11 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
Tue Dec 26 21:02:14 2006 Masaki Suketa <masaki.suketa@nifty.ne.jp>
- * test/win32ole/test_folderitem2_invokeverb.rb: The argument
+ * test/win32ole/test_folderitem2_invokeverb.rb: The argument
of Shell.NameSpace should not be file path.
Tue Dec 26 06:13:08 2006 Minero Aoki <aamine@loveruby.net>
View
38 call_cfunc.ci
@@ -17,76 +17,76 @@ call_cfunc(func, recv, len, argc, argv)
}
switch (len) {
- case -2:
+ case -2:
return (*func) (recv, rb_ary_new4(argc, argv));
break;
- case -1:
+ case -1:
return (*func) (argc, argv, recv);
break;
- case 0:
+ case 0:
return (*func) (recv);
break;
- case 1:
+ case 1:
return (*func) (recv, argv[0]);
break;
- case 2:
+ case 2:
return (*func) (recv, argv[0], argv[1]);
break;
- case 3:
+ case 3:
return (*func) (recv, argv[0], argv[1], argv[2]);
break;
- case 4:
+ case 4:
return (*func) (recv, argv[0], argv[1], argv[2], argv[3]);
break;
- case 5:
+ case 5:
return (*func) (recv, argv[0], argv[1], argv[2], argv[3], argv[4]);
break;
- case 6:
+ case 6:
return (*func) (recv, argv[0], argv[1], argv[2], argv[3], argv[4],
argv[5]);
break;
- case 7:
+ case 7:
return (*func) (recv, argv[0], argv[1], argv[2], argv[3], argv[4],
argv[5], argv[6]);
break;
- case 8:
+ case 8:
return (*func) (recv, argv[0], argv[1], argv[2], argv[3], argv[4],
argv[5], argv[6], argv[7]);
break;
- case 9:
+ case 9:
return (*func) (recv, argv[0], argv[1], argv[2], argv[3], argv[4],
argv[5], argv[6], argv[7], argv[8]);
break;
- case 10:
+ case 10:
return (*func) (recv, argv[0], argv[1], argv[2], argv[3], argv[4],
argv[5], argv[6], argv[7], argv[8], argv[9]);
break;
- case 11:
+ case 11:
return (*func) (recv, argv[0], argv[1], argv[2], argv[3], argv[4],
argv[5], argv[6], argv[7], argv[8], argv[9],
argv[10]);
break;
- case 12:
+ case 12:
return (*func) (recv, argv[0], argv[1], argv[2], argv[3], argv[4],
argv[5], argv[6], argv[7], argv[8], argv[9],
argv[10], argv[11]);
break;
- case 13:
+ case 13:
return (*func) (recv, argv[0], argv[1], argv[2], argv[3], argv[4],
argv[5], argv[6], argv[7], argv[8], argv[9], argv[10],
argv[11], argv[12]);
break;
- case 14:
+ case 14:
return (*func) (recv, argv[0], argv[1], argv[2], argv[3], argv[4],
argv[5], argv[6], argv[7], argv[8], argv[9], argv[10],
argv[11], argv[12], argv[13]);
break;
- case 15:
+ case 15:
return (*func) (recv, argv[0], argv[1], argv[2], argv[3], argv[4],
argv[5], argv[6], argv[7], argv[8], argv[9], argv[10],
argv[11], argv[12], argv[13], argv[14]);
break;
- default:
+ default:
rb_raise(rb_eArgError, "too many arguments(%d)", len);
break;
}
View
3,262 compile.c
1,639 additions, 1,623 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
12 dir.c
@@ -1209,19 +1209,19 @@ glob_helper(
p = p->next;
}
switch (p->type) {
- case PLAIN:
+ case PLAIN:
plain = 1;
break;
- case MAGICAL:
+ case MAGICAL:
magical = 1;
break;
- case MATCH_ALL:
+ case MATCH_ALL:
match_all = 1;
break;
- case MATCH_DIR:
+ case MATCH_DIR:
match_dir = 1;
break;
- case RECURSIVE:
+ case RECURSIVE:
rb_bug("continuous RECURSIVEs");
}
}
@@ -1593,7 +1593,7 @@ dir_globs(long argc, VALUE *argv, int flags)
* Dir[ string [, string ...] ] => array
*
* Equivalent to calling
- * <code>Dir.glob(</code><i>array,</i><code>0)</code> and
+ * <code>Dir.glob(</code><i>array,</i><code>0)</code> and
* <code>Dir.glob([</code><i>string,...</i><code>],0)</code>.
*
*/
View
180 eval.c
@@ -340,9 +340,9 @@ rb_eval_cmd(VALUE cmd, VALUE arg, int level)
/*
* call-seq:
* Module.nesting => array
- *
+ *
* Returns the list of +Modules+ nested at the point of call.
- *
+ *
* module M1
* module M2
* $a = Module.nesting
@@ -371,14 +371,14 @@ rb_mod_nesting(void)
/*
* call-seq:
* Module.constants => array
- *
+ *
* Returns an array of the names of all constants defined in the
* system. This list includes the names of all modules and classes.
- *
+ *
* p Module.constants.sort[1..5]
- *
+ *
* <em>produces:</em>
- *
+ *
* ["ARGV", "ArgumentError", "Array", "Bignum", "Binding"]
*/
@@ -421,11 +421,11 @@ rb_frozen_class_p(VALUE klass)
desc = "object";
else {
switch (TYPE(klass)) {
- case T_MODULE:
- case T_ICLASS:
+ case T_MODULE:
+ case T_ICLASS:
desc = "module";
break;
- case T_CLASS:
+ case T_CLASS:
desc = "class";
break;
}
@@ -437,7 +437,7 @@ rb_frozen_class_p(VALUE klass)
/*
* call-seq:
* obj.respond_to?(symbol, include_private=false) => true or false
- *
+ *
* Returns +true+> if _obj_ responds to the given
* method. Private methods are included in the search only if the
* optional second parameter evaluates to +true+.
@@ -472,7 +472,7 @@ rb_respond_to(VALUE obj, ID id)
/*
* call-seq:
* obj.respond_to?(symbol, include_private=false) => true or false
- *
+ *
* Returns +true+> if _obj_ responds to the given
* method. Private methods are included in the search only if the
* optional second parameter evaluates to +true+.
@@ -495,11 +495,11 @@ obj_respond_to(int argc, VALUE *argv, VALUE obj)
/*
* call-seq:
* mod.method_defined?(symbol) => true or false
- *
+ *
* Returns +true+ if the named method is defined by
* _mod_ (or its included modules and, if _mod_ is a class,
* its ancestors). Public and protected methods are matched.
- *
+ *
* module A
* def method1() end
* end
@@ -510,7 +510,7 @@ obj_respond_to(int argc, VALUE *argv, VALUE obj)
* include A
* def method3() end
* end
- *
+ *
* A.method_defined? :method1 #=> true
* C.method_defined? "method1" #=> true
* C.method_defined? "method2" #=> true
@@ -530,11 +530,11 @@ rb_mod_method_defined(mod, mid)
/*
* call-seq:
* mod.public_method_defined?(symbol) => true or false
- *
+ *
* Returns +true+ if the named public method is defined by
* _mod_ (or its included modules and, if _mod_ is a class,
* its ancestors).
- *
+ *
* module A
* def method1() end
* end
@@ -546,7 +546,7 @@ rb_mod_method_defined(mod, mid)
* include A
* def method3() end
* end
- *
+ *
* A.method_defined? :method1 #=> true
* C.public_method_defined? "method1" #=> true
* C.public_method_defined? "method2" #=> false
@@ -570,11 +570,11 @@ rb_mod_public_method_defined(VALUE mod, VALUE mid)
/*
* call-seq:
* mod.private_method_defined?(symbol) => true or false
- *
+ *
* Returns +true+ if the named private method is defined by
* _ mod_ (or its included modules and, if _mod_ is a class,
* its ancestors).
- *
+ *
* module A
* def method1() end
* end
@@ -586,7 +586,7 @@ rb_mod_public_method_defined(VALUE mod, VALUE mid)
* include A
* def method3() end
* end
- *
+ *
* A.method_defined? :method1 #=> true
* C.private_method_defined? "method1" #=> false
* C.private_method_defined? "method2" #=> true
@@ -610,11 +610,11 @@ rb_mod_private_method_defined(VALUE mod, VALUE mid)
/*
* call-seq:
* mod.protected_method_defined?(symbol) => true or false
- *
+ *
* Returns +true+ if the named protected method is defined
* by _mod_ (or its included modules and, if _mod_ is a
* class, its ancestors).
- *
+ *
* module A
* def method1() end
* end
@@ -626,7 +626,7 @@ rb_mod_private_method_defined(VALUE mod, VALUE mid)
* include A
* def method3() end
* end
- *
+ *
* A.method_defined? :method1 #=> true
* C.protected_method_defined? "method1" #=> false
* C.protected_method_defined? "method2" #=> true
@@ -745,7 +745,7 @@ rb_interrupt()
* fail
* fail(string)
* fail(exception [, string [, array]])
- *
+ *
* With no arguments, raises the exception in <code>$!</code> or raises
* a <code>RuntimeError</code> if <code>$!</code> is +nil+.
* With a single +String+ argument, raises a
@@ -756,7 +756,7 @@ rb_interrupt()
* message associated with the exception, and the third parameter is an
* array of callback information. Exceptions are caught by the
* +rescue+ clause of <code>begin...end</code> blocks.
- *
+ *
* raise "Failed to create socket"
* raise ArgumentError, "No parameters", caller
*/
@@ -787,10 +787,10 @@ rb_make_exception(int argc, VALUE *argv)
mesg = Qnil;
switch (argc) {
- case 0:
+ case 0:
mesg = Qnil;
break;
- case 1:
+ case 1:
if (NIL_P(argv[0]))
break;
if (TYPE(argv[0]) == T_STRING) {
@@ -800,8 +800,8 @@ rb_make_exception(int argc, VALUE *argv)
n = 0;
goto exception_call;
- case 2:
- case 3:
+ case 2:
+ case 3:
n = 1;
exception_call:
exception = rb_intern("exception");
@@ -810,7 +810,7 @@ rb_make_exception(int argc, VALUE *argv)
}
mesg = rb_funcall(argv[0], exception, n, argv[1]);
break;
- default:
+ default:
rb_raise(rb_eArgError, "wrong number of arguments");
break;
}
@@ -861,11 +861,11 @@ rb_iterator_p()
* call-seq:
* block_given? => true or false
* iterator? => true or false
- *
+ *
* Returns <code>true</code> if <code>yield</code> would execute a
* block in the current context. The <code>iterator?</code> form
* is mildly deprecated.
- *
+ *
* def try
* if block_given?
* yield
@@ -969,9 +969,9 @@ rb_yield_splat(VALUE values)
/*
* call-seq:
* loop {|| block }
- *
+ *
* Repeatedly executes the block.
- *
+ *
* loop do
* print "Input: "
* line = gets
@@ -1254,7 +1254,7 @@ stack_check(void)
/*
* call-seq:
* obj.method_missing(symbol [, *args] ) => result
- *
+ *
* Invoked by Ruby when <i>obj</i> is sent a message it cannot handle.
* <i>symbol</i> is the symbol for the method called, and <i>args</i>
* are any arguments that were passed to it. By default, the interpreter
@@ -1264,7 +1264,7 @@ stack_check(void)
* a class <code>Roman</code>, which responds to methods with names
* consisting of roman numerals, returning the corresponding integer
* values.
- *
+ *
* class Roman
* def romanToInt(str)
* # ...
@@ -1274,7 +1274,7 @@ stack_check(void)
* romanToInt(str)
* end
* end
- *
+ *
* r = Roman.new
* r.iv #=> 4
* r.xxiii #=> 23
@@ -1462,11 +1462,11 @@ send_funcall(int argc, VALUE *argv, VALUE recv, int scope)
* call-seq:
* obj.send(symbol [, args...]) => obj
* obj.__send__(symbol [, args...]) => obj
- *
+ *
* Invokes the method identified by _symbol_, passing it any
* arguments specified. You can use <code>__send__</code> if the name
* +send+ clashes with an existing method in _obj_.
- *
+ *
* class Klass
* def hello(*args)
* "Hello " + args.join(' ')
@@ -1494,12 +1494,12 @@ rb_f_send(int argc, VALUE *argv, VALUE recv)
* call-seq:
* obj.funcall(symbol [, args...]) => obj
* obj.__send!(symbol [, args...]) => obj
- *
+ *
* Invokes the method identified by _symbol_, passing it any
* arguments specified. Unlike send, which calls private methods only
* when it is invoked in function call style, funcall always aware of
* private methods.
- *
+ *
* 1.funcall(:puts, "hello") # prints "foo"
*/
@@ -1555,13 +1555,13 @@ backtrace(int lev)
/*
* call-seq:
* caller(start=1) => array
- *
+ *
* Returns the current execution stack---an array containing strings in
* the form ``<em>file:line</em>'' or ``<em>file:line: in
* `method'</em>''. The optional _start_ parameter
* determines the number of initial stack entries to omit from the
* result.
- *
+ *
* def a(skip)
* caller(skip)
* end
@@ -1710,7 +1710,7 @@ eval(VALUE self, VALUE src, VALUE scope, char *file, int line)
VALUE iseqval;
if (scope != Qnil) {
-
+
if (CLASS_OF(scope) == rb_cBinding) {
GetBindingPtr(scope, bind);
envval = bind->env;
@@ -1788,14 +1788,14 @@ eval(VALUE self, VALUE src, VALUE scope, char *file, int line)
/*
* call-seq:
* eval(string [, binding [, filename [,lineno]]]) => obj
- *
+ *
* Evaluates the Ruby expression(s) in <em>string</em>. If
* <em>binding</em> is given, the evaluation is performed in its
* context. The binding may be a <code>Binding</code> object or a
* <code>Proc</code> object. If the optional <em>filename</em> and
* <em>lineno</em> parameters are present, they will be used when
* reporting syntax errors.
- *
+ *
* def getBinding(str)
* return binding
* end
@@ -1865,7 +1865,7 @@ exec_under(VALUE (*func) (VALUE), VALUE under, VALUE self, VALUE args)
while (!RUBY_VM_NORMAL_ISEQ_P(cfp->iseq)) {
cfp = RUBY_VM_PREVIOUS_CONTROL_FRAME(cfp);
}
-
+
pcref = (NODE **) th_cfp_svar(cfp, -1);
stored_cref = *pcref;
*pcref = th_cref_push(th, under, NOEX_PUBLIC);
@@ -1890,7 +1890,7 @@ static VALUE
yield_under_i(VALUE arg)
{
int avalue = Qtrue;
-
+
if (arg == Qundef) {
avalue = Qfalse;
}
@@ -1974,7 +1974,7 @@ specific_eval(int argc, VALUE *argv, VALUE klass, VALUE self)
* call-seq:
* obj.instance_eval(string [, filename [, lineno]] ) => obj
* obj.instance_eval {| | block } => obj
- *
+ *
* Evaluates a string containing Ruby source code, or the given block,
* within the context of the receiver (_obj_). In order to set the
* context, the variable +self+ is set to _obj_ while
@@ -1983,7 +1983,7 @@ specific_eval(int argc, VALUE *argv, VALUE klass, VALUE self)
* that takes a +String+, the optional second and third
* parameters supply a filename and starting line number that are used
* when reporting compilation errors.
- *
+ *
* class Klass
* def initialize
* @secret = 99
@@ -2010,12 +2010,12 @@ rb_obj_instance_eval(int argc, VALUE *argv, VALUE self)
/*
* call-seq:
* obj.instance_exec(arg...) {|var...| block } => obj
- *
+ *
* Executes the given block within the context of the receiver
* (_obj_). In order to set the context, the variable +self+ is set
* to _obj_ while the code is executing, giving the code access to
* _obj_'s instance variables. Arguments are passed as block parameters.
- *
+ *
* class Klass
* def initialize
* @secret = 99
@@ -2043,21 +2043,21 @@ rb_obj_instance_exec(int argc, VALUE *argv, VALUE self)
* call-seq:
* mod.class_eval(string [, filename [, lineno]]) => obj
* mod.module_eval {|| block } => obj
- *
+ *
* Evaluates the string or block in the context of _mod_. This can
* be used to add methods to a class. <code>module_eval</code> returns
* the result of evaluating its argument. The optional _filename_
* and _lineno_ parameters set the text for error messages.
- *
+ *
* class Thing
* end
* a = %q{def hello() "Hello there!" end}
* Thing.module_eval(a)
* puts Thing.new.hello()
* Thing.module_eval("invalid code", "dummy", 123)
- *
+ *
* <em>produces:</em>
- *
+ *
* Hello there!
* dummy:123:in `module_eval': undefined local variable
* or method `code' for Thing:Class
@@ -2073,19 +2073,19 @@ rb_mod_module_eval(int argc, VALUE *argv, VALUE mod)
* call-seq:
* mod.module_exec(arg...) {|var...| block } => obj
* mod.class_exec(arg...) {|var...| block } => obj
- *
+ *
* Evaluates the given block in the context of the class/module.
* The method defined in the block will belong to the receiver.
- *
+ *
* class Thing
* end
* Thing.class_exec{
* def hello() "Hello there!" end
* }
* puts Thing.new.hello()
- *
+ *
* <em>produces:</em>
- *
+ *
* Hello there!
*/
@@ -2119,7 +2119,7 @@ set_method_visibility(VALUE self, int argc, VALUE *argv, ID ex)
* call-seq:
* public => self
* public(symbol, ...) => self
- *
+ *
* With no arguments, sets the default visibility for subsequently
* defined methods to public. With arguments, sets the named methods to
* have public visibility.
@@ -2142,7 +2142,7 @@ rb_mod_public(int argc, VALUE *argv, VALUE module)
* call-seq:
* protected => self
* protected(symbol, ...) => self
- *
+ *
* With no arguments, sets the default visibility for subsequently
* defined methods to protected. With arguments, sets the named methods
* to have protected visibility.
@@ -2165,11 +2165,11 @@ rb_mod_protected(int argc, VALUE *argv, VALUE module)
* call-seq:
* private => self
* private(symbol, ...) => self
- *
+ *
* With no arguments, sets the default visibility for subsequently
* defined methods to private. With arguments, sets the named methods
* to have private visibility.
- *
+ *
* module Mod
* def a() end
* def b() end
@@ -2196,7 +2196,7 @@ rb_mod_private(int argc, VALUE *argv, VALUE module)
/*
* call-seq:
* mod.public_class_method(symbol, ...) => mod
- *
+ *
* Makes a list of existing class methods public.
*/
@@ -2210,10 +2210,10 @@ rb_mod_public_method(int argc, VALUE *argv, VALUE obj)
/*
* call-seq:
* mod.private_class_method(symbol, ...) => mod
- *
+ *
* Makes existing class methods private. Often used to hide the default
* constructor <code>new</code>.
- *
+ *
* class SimpleSingleton # Not thread safe
* private_class_method :new
* def SimpleSingleton.create(*args, &block)
@@ -2234,7 +2234,7 @@ rb_mod_private_method(int argc, VALUE *argv, VALUE obj)
* call-seq:
* public
* public(symbol, ...)
- *
+ *
* With no arguments, sets the default visibility for subsequently
* defined methods to public. With arguments, sets the named methods to
* have public visibility.
@@ -2255,15 +2255,15 @@ top_private(int argc, VALUE *argv)
/*
* call-seq:
* module_function(symbol, ...) => self
- *
+ *
* Creates module functions for the named methods. These functions may
* be called with the module as a receiver, and also become available
* as instance methods to classes that mix in the module. Module
* functions are copies of the original, and so may be changed
* independently. The instance-method versions are made private. If
* used with no arguments, subsequently defined methods become module
* functions.
- *
+ *
* module Mod
* def one
* "This is one"
@@ -2335,7 +2335,7 @@ rb_mod_modfunc(int argc, VALUE *argv, VALUE module)
/*
* call-seq:
* append_features(mod) => mod
- *
+ *
* When this module is included in another, Ruby calls
* <code>append_features</code> in this module, passing it the
* receiving module in _mod_. Ruby's default implementation is
@@ -2348,10 +2348,10 @@ static VALUE
rb_mod_append_features(VALUE module, VALUE include)
{
switch (TYPE(include)) {
- case T_CLASS:
- case T_MODULE:
+ case T_CLASS:
+ case T_MODULE:
break;
- default:
+ default:
Check_Type(include, T_CLASS);
break;
}
@@ -2363,7 +2363,7 @@ rb_mod_append_features(VALUE module, VALUE include)
/*
* call-seq:
* include(module, ...) => self
- *
+ *
* Invokes <code>Module.append_features</code> on each parameter in turn.
*/
@@ -2397,11 +2397,11 @@ rb_extend_object(VALUE obj, VALUE module)
/*
* call-seq:
* extend_object(obj) => obj
- *
+ *
* Extends the specified object by adding this module's constants and
* methods (which are added as singleton methods). This is the callback
* method used by <code>Object#extend</code>.
- *
+ *
* module Picky
* def Picky.extend_object(o)
* if String === o
@@ -2414,9 +2414,9 @@ rb_extend_object(VALUE obj, VALUE module)
* end
* (s = Array.new).extend Picky # Call Object.extend
* (s = "quick brown fox").extend Picky
- *
+ *
* <em>produces:</em>
- *
+ *
* Picky added to Array
* Can't add Picky to a String
*/
@@ -2431,22 +2431,22 @@ rb_mod_extend_object(VALUE mod, VALUE obj)
/*
* call-seq:
* obj.extend(module, ...) => obj
- *
+ *
* Adds to _obj_ the instance methods from each module given as a
* parameter.
- *
+ *
* module Mod
* def hello
* "Hello from Mod.\n"
* end
* end
- *
+ *
* class Klass
* def hello
* "Hello from Klass.\n"
* end
* end
- *
+ *
* k = Klass.new
* k.hello #=> "Hello from Klass.\n"
* k.extend(Mod) #=> #<Klass:0x401b3bc8>
@@ -2473,7 +2473,7 @@ rb_obj_extend(int argc, VALUE *argv, VALUE obj)
/*
* call-seq:
* include(module, ...) => self
- *
+ *
* Invokes <code>Module.append_features</code>
* on each parameter in turn. Effectively adds the methods and constants
* in each module to the receiver.
@@ -2572,9 +2572,9 @@ errat_setter(VALUE val, ID id, VALUE *var)
/*
* call-seq:
* local_variables => array
- *
+ *
* Returns the names of the current local variables.
- *
+ *
* fred = 1
* for i in 1..10
* # ...
@@ -2630,7 +2630,7 @@ rb_f_local_variables(void)
/*
* call-seq:
* __method__ => symbol
- *
+ *
* Returns the name of the current method as a Symbol.
* If called from inside of an aliased method it will return the original
* nonaliased name.
@@ -2655,7 +2655,7 @@ rb_f_method_name(void)
/*
* call-seq:
* __callee__ => symbol
- *
+ *
* Returns the name of the current method as Symbol.
* If called from inside of an aliased method it will return the aliased
* name.
@@ -2683,7 +2683,7 @@ Init_eval(void)
{
/* TODO: fix position */
GET_THREAD()->vm->mark_object_ary = rb_ary_new();
-
+
init = rb_intern("initialize");
eqq = rb_intern("===");
each = rb_intern("each");
@@ -2729,7 +2729,7 @@ Init_eval(void)
rb_define_global_function("__method__", rb_f_method_name, 0);
rb_define_global_function("__callee__", rb_f_callee_name, 0);
-
+
rb_define_method(rb_cBasicObject, "send", rb_f_send, -1);
rb_define_method(rb_cBasicObject, "__send__", rb_f_send, -1);
rb_define_method(rb_cBasicObject, "__send", rb_f_send, -1);
View
46 eval_jump.h
@@ -9,7 +9,7 @@ NORETURN(static VALUE rb_f_throw _((int, VALUE *)));
/*
* call-seq:
* throw(symbol [, obj])
- *
+ *
* Transfers control to the end of the active +catch+ block
* waiting for _symbol_. Raises +NameError+ if there
* is no +catch+ block for the symbol. The optional second
@@ -61,7 +61,7 @@ rb_throw(const char *tag, VALUE val)
/*
* call-seq:
* catch(symbol) {| | block } > obj
- *
+ *
* +catch+ executes its block. If a +throw+ is
* executed, Ruby searches up its stack for a +catch+ block
* with a tag corresponding to the +throw+'s
@@ -71,18 +71,18 @@ rb_throw(const char *tag, VALUE val)
* the value of +catch+ is the value of the last expression
* evaluated. +catch+ expressions may be nested, and the
* +throw+ call need not be in lexical scope.
- *
+ *
* def routine(n)
* puts n
* throw :done if n <= 0
* routine(n-1)
* end
- *
- *
+ *
+ *
* catch(:done) { routine(3) }
- *
+ *
* <em>produces:</em>
- *
+ *
* 3
* 2
* 1
@@ -162,35 +162,35 @@ rb_exit(int status)
* exit(integer=0)
* Kernel::exit(integer=0)
* Process::exit(integer=0)
- *
+ *
* Initiates the termination of the Ruby script by raising the
* <code>SystemExit</code> exception. This exception may be caught. The
* optional parameter is used to return a status code to the invoking
* environment.
- *
+ *
* begin
* exit
* puts "never get here"
* rescue SystemExit
* puts "rescued a SystemExit exception"
* end
* puts "after begin block"
- *
+ *
* <em>produces:</em>
- *
+ *
* rescued a SystemExit exception
* after begin block
- *
+ *
* Just prior to termination, Ruby executes any <code>at_exit</code> functions
* (see Kernel::at_exit) and runs any object finalizers (see
* ObjectSpace::define_finalizer).
- *
+ *
* at_exit { puts "at_exit function" }
* ObjectSpace.define_finalizer("string", proc { puts "in finalizer" })
* exit
- *
+ *
* <em>produces:</em>
- *
+ *
* at_exit function
* in finalizer
*/
@@ -204,13 +204,13 @@ rb_f_exit(int argc, VALUE *argv)
rb_secure(4);
if (rb_scan_args(argc, argv, "01", &status) == 1) {
switch (status) {
- case Qtrue:
+ case Qtrue:
istatus = EXIT_SUCCESS;
break;
- case Qfalse:
+ case Qfalse:
istatus = EXIT_FAILURE;
break;
- default:
+ default:
istatus = NUM2INT(status);
#if EXIT_SUCCESS != 0
if (istatus == 0)
@@ -232,7 +232,7 @@ rb_f_exit(int argc, VALUE *argv)
* abort
* Kernel::abort
* Process::abort
- *
+ *
* Terminate execution immediately, effectively by calling
* <code>Kernel.exit(1)</code>. If _msg_ is given, it is written
* to STDERR prior to terminating.
@@ -272,21 +272,21 @@ call_end_proc(VALUE data)
/*
* call-seq:
* at_exit { block } -> proc
- *
+ *
* Converts _block_ to a +Proc+ object (and therefore
* binds it at the point of call) and registers it for execution when
* the program exits. If multiple handlers are registered, they are
* executed in reverse order of registration.
- *
+ *
* def do_at_exit(str1)
* at_exit { print str1 }
* end
* at_exit { puts "cruel world" }
* do_at_exit("goodbye ")
* exit
- *
+ *
* <em>produces:</em>
- *
+ *
* goodbye cruel world
*/
View
36 eval_method.h
@@ -317,7 +317,7 @@ rb_remove_method(VALUE klass, const char *name)
/*
* call-seq:
* remove_method(symbol) => self
- *
+ *
* Removes the method identified by _symbol_ from the current
* class. For an example, see <code>Module.undef_method</code>.
*/
@@ -460,8 +460,8 @@ rb_undef(VALUE klass, ID id)
VALUE obj = rb_iv_get(klass, "__attached__");
switch (TYPE(obj)) {
- case T_MODULE:
- case T_CLASS:
+ case T_MODULE:
+ case T_CLASS:
c = obj;
s0 = "";
}
@@ -487,12 +487,12 @@ rb_undef(VALUE klass, ID id)
/*
* call-seq:
* undef_method(symbol) => self
- *
+ *
* Prevents the current class from responding to calls to the named
* method. Contrast this with <code>remove_method</code>, which deletes
* the method from the particular class; Ruby will still search
* superclasses and mixed-in modules for a possible receiver.
- *
+ *
* class Parent
* def hello
* puts "In parent"
@@ -503,25 +503,25 @@ rb_undef(VALUE klass, ID id)
* puts "In child"
* end
* end
- *
- *
+ *
+ *
* c = Child.new
* c.hello
- *
- *
+ *
+ *
* class Child
* remove_method :hello # remove from child, still in parent
* end
* c.hello
- *
- *
+ *
+ *
* class Child
* undef_method :hello # prevent any calls to 'hello'
* end
* c.hello
- *
+ *
* <em>produces:</em>
- *
+ *
* In child
* In parent
* prog.rb:23: undefined method `hello' for #<Child:0x401b3bb4> (NoMethodError)
@@ -563,7 +563,7 @@ rb_alias(VALUE klass, ID name, ID def)
}
orig_fbody->nd_cnt++;
-
+
if (st_lookup(RCLASS(klass)->m_tbl, name, (st_data_t *) & node)) {
if (node) {
if (RTEST(ruby_verbose) && node->nd_cnt == 0 && node->nd_body) {
@@ -594,10 +594,10 @@ rb_alias(VALUE klass, ID name, ID def)
/*
* call-seq:
* alias_method(new_name, old_name) => self
- *
+ *
* Makes <i>new_name</i> a new copy of the method <i>old_name</i>. This can
* be used to retain access to methods that are overridden.
- *
+ *
* module Mod
* alias_method :orig_exit, :exit
* def exit(code=0)
@@ -607,9 +607,9 @@ rb_alias(VALUE klass, ID name, ID def)
* end
* include Mod
* exit(99)
- *
+ *
* <em>produces:</em>
- *
+ *
* Exiting with code 99
*/
View
48 numeric.c
@@ -1225,7 +1225,7 @@ flo_ceil(VALUE num)
*
* Rounds <i>flt</i> to a given precision in decimal digits (default 0 digits).
* Precision may be negative. Returns a a floating point number when ndigits
- * is more than one.
+ * is more than one.
*
* 1.5.round #=> 2
* (-1.5).round #=> -2
@@ -1624,7 +1624,7 @@ rb_num2ll(VALUE val)
if (FIXNUM_P(val)) return (LONG_LONG)FIX2LONG(val);
switch (TYPE(val)) {
- case T_FLOAT:
+ case T_FLOAT:
if (RFLOAT(val)->value <= (double)LLONG_MAX
&& RFLOAT(val)->value >= (double)LLONG_MIN) {
return (LONG_LONG)(RFLOAT(val)->value);
@@ -1638,21 +1638,21 @@ rb_num2ll(VALUE val)
rb_raise(rb_eRangeError, "float %s out of range of long long", buf);
}
- case T_BIGNUM:
+ case T_BIGNUM:
return rb_big2ll(val);
- case T_STRING:
+ case T_STRING:
rb_raise(rb_eTypeError, "no implicit conversion from string");
return Qnil; /* not reached */
- case T_TRUE:
- case T_FALSE:
+ case T_TRUE:
+ case T_FALSE:
rb_raise(rb_eTypeError, "no implicit conversion from boolean");
return Qnil; /* not reached */
default:
- val = rb_to_int(val);
- return NUM2LL(val);
+ val = rb_to_int(val);
+ return NUM2LL(val);
}
}
@@ -1867,14 +1867,14 @@ static VALUE
rb_int_induced_from(VALUE klass, VALUE x)
{
switch (TYPE(x)) {
- case T_FIXNUM:
- case T_BIGNUM:
- return x;
- case T_FLOAT:
- return rb_funcall(x, id_to_i, 0);
- default:
- rb_raise(rb_eTypeError, "failed to convert %s into Integer",
- rb_obj_classname(x));
+ case T_FIXNUM:
+ case T_BIGNUM:
+ return x;
+ case T_FLOAT:
+ return rb_funcall(x, id_to_i, 0);
+ default:
+ rb_raise(rb_eTypeError, "failed to convert %s into Integer",
+ rb_obj_classname(x));
}
}
@@ -1889,14 +1889,14 @@ static VALUE
rb_flo_induced_from(VALUE klass, VALUE x)
{
switch (TYPE(x)) {
- case T_FIXNUM:
- case T_BIGNUM:
- return rb_funcall(x, rb_intern("to_f"), 0);
- case T_FLOAT:
- return x;
- default:
- rb_raise(rb_eTypeError, "failed to convert %s into Float",
- rb_obj_classname(x));
+ case T_FIXNUM:
+ case T_BIGNUM:
+ return rb_funcall(x, rb_intern("to_f"), 0);
+ case T_FLOAT:
+ return x;
+ default:
+ rb_raise(rb_eTypeError, "failed to convert %s into Float",
+ rb_obj_classname(x));
}
}
View
50 pack.c
@@ -344,13 +344,13 @@ num2i32(VALUE x)
}
#if SIZEOF_LONG == SIZE32
-# define EXTEND32(x)
+# define EXTEND32(x)
#else
/* invariant in modulo 1<<31 */
# define EXTEND32(x) do { if (!natint) {(x) = (((1L<<31)-1-(x))^~(~0L<<31));}} while(0)
#endif
#if SIZEOF_SHORT == SIZE16
-# define EXTEND16(x)
+# define EXTEND16(x)
#else
# define EXTEND16(x) do { if (!natint) {(x) = (short)(((1<<15)-1-(x))^~(~0<<15));}} while(0)
#endif
@@ -371,7 +371,7 @@ static unsigned long utf8_to_uv(const char*,long*);
/*
* call-seq:
* arr.pack ( aTemplateString ) -> aBinaryString
- *
+ *
* Packs the contents of <i>arr</i> into a binary sequence according to
* the directives in <i>aTemplateString</i> (see the table below)
* Directives ``A,'' ``a,'' and ``Z'' may be followed by a count,
@@ -384,13 +384,13 @@ static unsigned long utf8_to_uv(const char*,long*);
* platform's native size for the specified type; otherwise, they use a
* platform-independent size. Spaces are ignored in the template
* string. See also <code>String#unpack</code>.
- *
+ *
* a = [ "a", "b", "c" ]
* n = [ 65, 66, 67 ]
* a.pack("A3A3A3") #=> "a b c "
* a.pack("a3a3a3") #=> "a\000\000b\000\000c\000\000"
* n.pack("ccc") #=> "ABC"
- *
+ *
* Directives for +pack+.
*
* Directive Meaning
@@ -1101,16 +1101,16 @@ static inline int
hex2num(char c)
{
switch (c) {
- case '0': case '1': case '2': case '3': case '4':
- case '5': case '6': case '7': case '8': case '9':
+ case '0': case '1': case '2': case '3': case '4':
+ case '5': case '6': case '7': case '8': case '9':
return c - '0';
- case 'a': case 'b': case 'c':
- case 'd': case 'e': case 'f':
+ case 'a': case 'b': case 'c':
+ case 'd': case 'e': case 'f':
return c - 'a' + 10;
- case 'A': case 'B': case 'C':
- case 'D': case 'E': case 'F':
+ case 'A': case 'B': case 'C':
+ case 'D': case 'E': case 'F':
return c - 'A' + 10;
- default:
+ default:
return -1;
}
}
@@ -1145,11 +1145,11 @@ infected_str_new(const char *ptr, long len, VALUE str)
OBJ_INFECT(s, str);
return s;
}
-
+
/*
* call-seq:
* str.unpack(format) => anArray
- *
+ *
* Decodes <i>str</i> (which may contain binary data) according to the
* format string, returning an array of each value extracted. The
* format string consists of a sequence of single-character directives,
@@ -1162,7 +1162,7 @@ infected_str_new(const char *ptr, long len, VALUE str)
* platform's native size for the specified type; otherwise, it uses a
* platform-independent consistent size. Spaces are ignored in the
* format string. See also <code>Array#pack</code>.
- *
+ *
* "abc \0\0abc \0\0".unpack('A6Z6') #=> ["abc", "abc "]
* "abc \0\0".unpack('a3a3') #=> ["abc", " \000\000"]
* "abc \0abc \0".unpack('Z*Z*') #=> ["abc ", "abc "]
@@ -1174,7 +1174,7 @@ infected_str_new(const char *ptr, long len, VALUE str)
*
* This table summarizes the various formats and the Ruby classes
* returned by each.
- *
+ *
* Format | Returns | Function
* -------+---------+-----------------------------------------
* A | String | with trailing nulls and spaces removed
@@ -1246,17 +1246,17 @@ infected_str_new(const char *ptr, long len, VALUE str)
* p | String | treat sizeof(char *) characters as a
* | | pointer to a null-terminated string
* -------+---------+-----------------------------------------
- * Q | Integer | treat 8 characters as an unsigned
+ * Q | Integer | treat 8 characters as an unsigned
* | | quad word (64 bits)
* -------+---------+-----------------------------------------
- * q | Integer | treat 8 characters as a signed
+ * q | Integer | treat 8 characters as a signed
* | | quad word (64 bits)
* -------+---------+-----------------------------------------
* S | Fixnum | treat two (different if _ used)
* | | successive characters as an unsigned
* | | short in native byte order
* -------+---------+-----------------------------------------
- * s | Fixnum | Treat two (different if _ used)
+ * s | Fixnum | Treat two (different if _ used)
* | | successive characters as a signed short
* | | in native byte order
* -------+---------+-----------------------------------------
@@ -1279,7 +1279,7 @@ infected_str_new(const char *ptr, long len, VALUE str)
* Z | String | with trailing nulls removed
* | | upto first null with *
* -------+---------+-----------------------------------------
- * @ | --- | skip to the offset given by the
+ * @ | --- | skip to the offset given by the
* | | length argument
* -------+---------+-----------------------------------------
*/
@@ -1574,7 +1574,7 @@ pack_unpack(VALUE str, VALUE fmt)
}
PACK_ITEM_ADJUST();
break;
- case 'Q':
+ case 'Q':
PACK_LENGTH_ADJUST_SIZE(QUAD_SIZE);
while (len-- > 0) {
char *tmp = (char*)s;
@@ -1652,7 +1652,7 @@ pack_unpack(VALUE str, VALUE fmt)
}
PACK_ITEM_ADJUST();
break;
-
+
case 'E':
PACK_LENGTH_ADJUST(double,sizeof(double));
while (len-- > 0) {
@@ -1666,7 +1666,7 @@ pack_unpack(VALUE str, VALUE fmt)
}
PACK_ITEM_ADJUST();
break;
-
+
case 'D':
case 'd':
PACK_LENGTH_ADJUST(double,sizeof(double));
@@ -1692,7 +1692,7 @@ pack_unpack(VALUE str, VALUE fmt)
}
PACK_ITEM_ADJUST();
break;
-
+
case 'G':
PACK_LENGTH_ADJUST(double,sizeof(double));
while (len-- > 0) {
@@ -1706,7 +1706,7 @@ pack_unpack(VALUE str, VALUE fmt)
}
PACK_ITEM_ADJUST();
break;
-
+
case 'U':
if (len > send - s) len = send - s;
while (len > 0 && s < send) {
View
32 parse.y
@@ -171,7 +171,7 @@ vtable_add(struct vtable *tbl, ID id)
rb_bug("vtable_add: vtable is not allocated (%p)", tbl);
}
if (VTBL_DEBUG) printf("vtable_add: %p, %s\n", tbl, rb_id2name(id));
-
+
if (tbl->pos == tbl->capa) {
tbl->capa = tbl->capa * 2;
REALLOC_N(tbl->tbl, ID, tbl->capa);
@@ -4055,7 +4055,7 @@ f_norm_arg : tCONSTANT
{
/*%%%*/
yyerror("formal argument cannot be a constant");
- $$ = 0;
+ $$ = 0;
/*%
$$ = dispatch1(param_error, $1);
%*/
@@ -4064,7 +4064,7 @@ f_norm_arg : tCONSTANT
{
/*%%%*/
yyerror("formal argument cannot be an instance variable");
- $$ = 0;
+ $$ = 0;
/*%
$$ = dispatch1(param_error, $1);
%*/
@@ -4073,7 +4073,7 @@ f_norm_arg : tCONSTANT
{
/*%%%*/
yyerror("formal argument cannot be a global variable");
- $$ = 0;
+ $$ = 0;
/*%
$$ = dispatch1(param_error, $1);
%*/
@@ -4082,7 +4082,7 @@ f_norm_arg : tCONSTANT
{
/*%%%*/
yyerror("formal argument cannot be a class variable");
- $$ = 0;
+ $$ = 0;
/*%
$$ = dispatch1(param_error, $1);
%*/
@@ -4642,7 +4642,7 @@ rb_parser_compile_string(volatile VALUE vparser, const char *f, VALUE s, int lin
struct parser_params *parser;
NODE *node;
volatile VALUE tmp;
-
+
Data_Get_Struct(vparser, struct parser_params, parser);
lex_gets = lex_get_str;
lex_gets_ptr = 0;
@@ -4688,7 +4688,7 @@ rb_parser_compile_file(volatile VALUE vparser, const char *f, VALUE file, int st
struct parser_params *parser;
volatile VALUE tmp;
NODE *node;
-
+
Data_Get_Struct(vparser, struct parser_params, parser);
lex_gets = lex_io_gets;
lex_input = file;
@@ -5489,7 +5489,7 @@ parser_pragma(struct parser_params *parser, const char *str, int len)
if (!(end = pragma_marker(beg, str + len - beg))) return Qfalse;
str = beg;
len = end - beg - 3;
-
+
/* %r"([^\\s\'\":;]+)\\s*:\\s*(\"(?:\\\\.|[^\"])*\"|[^\"\\s;]+)[\\s;]*" */
while (len > 0) {
#ifndef RIPPER
@@ -6314,7 +6314,7 @@ parser_yylex(struct parser_params *parser)
lex_state = EXPR_DOT;
return tCOLON2;
}
- if (lex_state == EXPR_END ||
+ if (lex_state == EXPR_END ||
lex_state == EXPR_ENDARG || ISSPACE(c)) {
pushback(c);
lex_state = EXPR_BEG;
@@ -7915,7 +7915,7 @@ arg_dup_check(ID vid, VALUE m, VALUE list, NODE *node)
ruby_sourceline = nd_line(node);
return 1;
}
- rb_ary_push(list, sym);
+ rb_ary_push(list, sym);
return 0;
}
@@ -8114,7 +8114,7 @@ rb_parser_append_print(NODE *node)
NODE *prelude = 0;
NODE *scope = node;
node = node->nd_body;
-
+
if (node && (nd_type(node) == NODE_PRELUDE)) {
prelude = node;
node = node->nd_body;
@@ -8523,15 +8523,15 @@ symbols_i(VALUE sym, ID value, VALUE ary)
/*
* call-seq:
* Symbol.all_symbols => array
- *
+ *
* Returns an array of all the symbols currently in Ruby's symbol
* table.
- *
+ *
* Symbol.all_symbols.size #=> 903
* Symbol.all_symbols[1,20] #=> [:floor, :ARGV, :Binding, :symlink,
- * :chown, :EOFError, :$;, :String,
- * :LOCK_SH, :"setuid?", :$<,
- * :default_proc, :compact, :extend,
+ * :chown, :EOFError, :$;, :String,
+ * :LOCK_SH, :"setuid?", :$<,
+ * :default_proc, :compact, :extend,
* :Tms, :getwd, :$=, :ThreadGroup,
* :wait2, :$>]
*/
View
287 re.c
@@ -172,115 +172,118 @@ rb_memsearch(const void *x0, long m, const void *y0, long n)
static int reg_kcode = DEFAULT_KCODE;
-static int char_to_option(int c)
-{
- int val;
-
- switch (c) {
- case 'i':
- val = ONIG_OPTION_IGNORECASE;
- break;
- case 'x':
- val = ONIG_OPTION_EXTEND;
- break;
- case 'm':
- val = ONIG_OPTION_MULTILINE;
- break;
- default:
- val = 0;
- break;
- }
- return val;
-}
-
-extern int rb_char_to_option_kcode(int c, int *option, int *kcode)
-{
- *option = 0;
-
- switch (c) {
- case 'n':
- *kcode = ARG_KCODE_NONE;
- break;
- case 'e':
- *kcode = ARG_KCODE_EUC;
- break;
- case 's':
- *kcode = ARG_KCODE_SJIS;
- break;
- case 'u':
- *kcode = ARG_KCODE_UTF8;
- break;
- default:
- *kcode = 0;
- *option = char_to_option(c);
- break;
- }
+static int
+char_to_option(int c)
+{
+ int val;
- return ((*kcode == 0 && *option == 0) ? 0 : 1);
+ switch (c) {
+ case 'i':
+ val = ONIG_OPTION_IGNORECASE;
+ break;
+ case 'x':
+ val = ONIG_OPTION_EXTEND;
+ break;
+ case 'm':
+ val = ONIG_OPTION_MULTILINE;
+ break;
+ default:
+ val = 0;
+ break;
+ }
+ return val;
}
-static int char_to_arg_kcode(int c)
+extern int
+rb_char_to_option_kcode(int c, int *option, int *kcode)
{
- int kcode, option;
+ *option = 0;
- if (ISUPPER(c)) c = tolower(c);
+ switch (c) {
+ case 'n':
+ *kcode = ARG_KCODE_NONE;
+ break;
+ case 'e':
+ *kcode = ARG_KCODE_EUC;
+ break;
+ case 's':
+ *kcode = ARG_KCODE_SJIS;
+ break;
+ case 'u':
+ *kcode = ARG_KCODE_UTF8;
+ break;
+ default:
+ *kcode = 0;
+ *option = char_to_option(c);
+ break;
+ }
- (void )rb_char_to_option_kcode(c, &option, &kcode);
- return kcode;
+ return ((*kcode == 0 && *option == 0) ? 0 : 1);
+}
+
+static int
+char_to_arg_kcode(int c)
+{
+ int kcode, option;
+
+ if (ISUPPER(c)) c = tolower(c);
+
+ (void )rb_char_to_option_kcode(c, &option, &kcode);
+ return kcode;
}
static int
kcode_to_arg_value(unsigned int kcode)
{
- switch (kcode & KCODE_MASK) {
- case KCODE_NONE:
- return ARG_KCODE_NONE;
- case KCODE_EUC:
- return ARG_KCODE_EUC;
- case KCODE_SJIS:
- return ARG_KCODE_SJIS;
- case KCODE_UTF8:
- return ARG_KCODE_UTF8;
- default:
- return 0;
- }
+ switch (kcode & KCODE_MASK) {
+ case KCODE_NONE:
+ return ARG_KCODE_NONE;
+ case KCODE_EUC:
+ return ARG_KCODE_EUC;
+ case KCODE_SJIS:
+ return ARG_KCODE_SJIS;
+ case KCODE_UTF8:
+ return ARG_KCODE_UTF8;
+ default:
+ return 0;
+ }
}
static void
set_re_kcode_by_option(struct RRegexp *re, int options)
{
- switch (options & ARG_KCODE_MASK) {
- case ARG_KCODE_NONE:
- FL_UNSET(re, KCODE_MASK);
- FL_SET(re, KCODE_FIXED);
- break;
- case ARG_KCODE_EUC:
- FL_UNSET(re, KCODE_MASK);
- FL_SET(re, KCODE_EUC);
- FL_SET(re, KCODE_FIXED);
- break;
- case ARG_KCODE_SJIS:
- FL_UNSET(re, KCODE_MASK);
- FL_SET(re, KCODE_SJIS);
- FL_SET(re, KCODE_FIXED);
- break;
- case ARG_KCODE_UTF8:
- FL_UNSET(re, KCODE_MASK);
- FL_SET(re, KCODE_UTF8);
- FL_SET(re, KCODE_FIXED);
- break;
-
- case 0:
- default:
- FL_SET(re, reg_kcode);
- break;
+ switch (options & ARG_KCODE_MASK) {
+ case ARG_KCODE_NONE:
+ FL_UNSET(re, KCODE_MASK);
+ FL_SET(re, KCODE_FIXED);
+ break;
+ case ARG_KCODE_EUC:
+ FL_UNSET(re, KCODE_MASK);
+ FL_SET(re, KCODE_EUC);
+ FL_SET(re, KCODE_FIXED);
+ break;
+ case ARG_KCODE_SJIS:
+ FL_UNSET(re, KCODE_MASK);
+ FL_SET(re, KCODE_SJIS);
+ FL_SET(re, KCODE_FIXED);
+ break;
+ case ARG_KCODE_UTF8:
+ FL_UNSET(re, KCODE_MASK);
+ FL_SET(re, KCODE_UTF8);
+ FL_SET(re, KCODE_FIXED);
+ break;
+
+ case 0:
+ default:
+ FL_SET(re, reg_kcode);
+ break;
}
}
static int
re_to_kcode_arg_value(VALUE re)
{
- return kcode_to_arg_value(RBASIC(re)->flags);
+ return kcode_to_arg_value(RBASIC(re)->flags);
}
static int curr_kcode;
@@ -444,9 +447,9 @@ rb_reg_desc(const char *s, long len, VALUE re)
/*
* call-seq:
* rxp.source => str
- *
+ *
* Returns the original string of the pattern.
- *
+ *
* /ab+c/ix.source #=> "ab+c"
*/
@@ -483,15 +486,15 @@ rb_reg_inspect(VALUE re)
/*
* call-seq:
* rxp.to_s => str
- *
+ *
* Returns a string containing the regular expression and its options (using the
* <code>(?xxx:yyy)</code> notation. This string can be fed back in to
* <code>Regexp::new</code> to a regular expression with the same semantics as
* the original. (However, <code>Regexp#==</code> may not return true when
* comparing the two, as the source of the regular expression itself may
* differ, as the example shows). <code>Regexp#inspect</code> produces a
* generally more readable version of <i>rxp</i>.
- *
+ *
* r1 = /ab+c/ix #=> /ab+c/ix
* s1 = r1.to_s #=> "(?ix-m:ab+c)"
* r2 = Regexp.new(s1) #=> /(?ix-m:ab+c)/
@@ -606,7 +609,7 @@ rb_reg_raise(const char *s, long len, const char *err, VALUE re, int ce)
/*
* call-seq:
* rxp.casefold? => true or false
- *
+ *
* Returns the value of the case-insensitive flag.
*/
@@ -622,22 +625,22 @@ rb_reg_casefold_p(VALUE re)
/*
* call-seq:
* rxp.options => fixnum
- *
+ *
* Returns the set of bits corresponding to the options used when creating this
* Regexp (see <code>Regexp::new</code> for details. Note that additional bits
* may be set in the returned options: these are used internally by the regular
* expression code. These extra bits are ignored if the options are passed to
* <code>Regexp::new</code>.
- *
+ *
* Regexp::IGNORECASE #=> 1
* Regexp::EXTENDED #=> 2
* Regexp::MULTILINE #=> 4
- *
+ *
* /cat/.options #=> 128
* /cat/ix.options #=> 131
* Regexp.new('cat', true).options #=> 129
* Regexp.new('cat', 0, 's').options #=> 384
- *
+ *
* r = /cat/ix
* Regexp.new(r.source, r.options) #=> /cat/ix
*/
@@ -653,7 +656,7 @@ rb_reg_options_m(VALUE re)
/*
* call-seq:
* rxp.kcode => str
- *
+ *
* Returns the character set code for the regexp.
*/
@@ -769,9 +772,9 @@ match_init_copy(VALUE obj, VALUE orig)
* call-seq:
* mtch.length => integer
* mtch.size => integer
- *
+ *
* Returns the number of elements in the match array.
- *
+ *
* m = /(.)(.)(\d+)(\d)/.match("THX1138.")
* m.length #=> 5
* m.size #=> 5
@@ -787,10 +790,10 @@ match_size(VALUE match)
/*
* call-seq:
* mtch.offset(n) => array
- *
+ *
* Returns a two-element array containing the beginning and ending offsets of
* the <em>n</em>th match.
- *
+ *
* m = /(.)(.)(\d+)(\d)/.match("THX1138.")
* m.offset(0) #=> [1, 7]
* m.offset(4) #=> [6, 7]
@@ -815,10 +818,10 @@ match_offset(VALUE match, VALUE n)
/*
* call-seq:
* mtch.begin(n) => integer
- *
+ *
* Returns the offset of the start of the <em>n</em>th element of the match
* array in the string.
- *
+ *
* m = /(.)(.)(\d+)(\d)/.match("THX1138.")
* m.begin(0) #=> 1
* m.begin(2) #=> 2
@@ -842,10 +845,10 @@ match_begin(VALUE match, VALUE n)
/*
* call-seq:
* mtch.end(n) => integer
- *
+ *