diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2019-03-22 11:04:59 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2019-03-22 11:04:59 +0000 |
commit | 56557ec28a8712984a0e9744fd7547e797ec9b6b (patch) | |
tree | a9fdee9c62afc0d8c50e56414708b00861a633ea /cont.c | |
parent | c671f836b4d123bf86bce6defe42c87caef582f8 (diff) |
[DOC] fix markups [ci skip]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67337 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'cont.c')
-rw-r--r-- | cont.c | 49 |
1 files changed, 24 insertions, 25 deletions
@@ -1135,7 +1135,7 @@ cont_restore_0(rb_context_t *cont, VALUE *addr_in_prev_frame) * Continuation objects are generated by Kernel#callcc, * after having +require+d <i>continuation</i>. They hold * a return address and execution context, allowing a nonlocal return - * to the end of the <code>callcc</code> block from anywhere within a + * to the end of the #callcc block from anywhere within a * program. Continuations are somewhat analogous to a structured * version of C's <code>setjmp/longjmp</code> (although they contain * more state, so you might consider them closer to threads). @@ -1320,11 +1320,10 @@ rollback_ensure_stack(VALUE self,rb_ensure_list_t *current,rb_ensure_entry_t *ta * cont.call(args, ...) * cont[args, ...] * - * Invokes the continuation. The program continues from the end of the - * <code>callcc</code> block. If no arguments are given, the original - * <code>callcc</code> returns <code>nil</code>. If one argument is - * given, <code>callcc</code> returns it. Otherwise, an array - * containing <i>args</i> is returned. + * Invokes the continuation. The program continues from the end of + * the #callcc block. If no arguments are given, the original #callcc + * returns +nil+. If one argument is given, #callcc returns + * it. Otherwise, an array containing <i>args</i> is returned. * * callcc {|cont| cont.call } #=> nil * callcc {|cont| cont.call 1 } #=> 1 @@ -1376,10 +1375,10 @@ rb_cont_call(int argc, VALUE *argv, VALUE contval) * manpage to configure the size of the fiber stack(s). * * When a fiber is created it will not run automatically. Rather it must - * be explicitly asked to run using the <code>Fiber#resume</code> method. + * be explicitly asked to run using the Fiber#resume method. * The code running inside the fiber can give up control by calling - * <code>Fiber.yield</code> in which case it yields control back to caller - * (the caller of the <code>Fiber#resume</code>). + * Fiber.yield in which case it yields control back to caller (the + * caller of the Fiber#resume). * * Upon yielding or termination the Fiber returns the value of the last * executed expression @@ -1401,10 +1400,10 @@ rb_cont_call(int argc, VALUE *argv, VALUE contval) * 2 * FiberError: dead fiber called * - * The <code>Fiber#resume</code> method accepts an arbitrary number of - * parameters, if it is the first call to <code>resume</code> then they - * will be passed as block arguments. Otherwise they will be the return - * value of the call to <code>Fiber.yield</code> + * The Fiber#resume method accepts an arbitrary number of parameters, + * if it is the first call to #resume then they will be passed as + * block arguments. Otherwise they will be the return value of the + * call to Fiber.yield * * Example: * @@ -1946,16 +1945,16 @@ rb_fiber_alive_p(VALUE fibval) * call-seq: * fiber.resume(args, ...) -> obj * - * Resumes the fiber from the point at which the last <code>Fiber.yield</code> - * was called, or starts running it if it is the first call to - * <code>resume</code>. Arguments passed to resume will be the value of - * the <code>Fiber.yield</code> expression or will be passed as block - * parameters to the fiber's block if this is the first <code>resume</code>. + * Resumes the fiber from the point at which the last Fiber.yield was + * called, or starts running it if it is the first call to + * #resume. Arguments passed to resume will be the value of the + * Fiber.yield expression or will be passed as block parameters to + * the fiber's block if this is the first #resume. * * Alternatively, when resume is called it evaluates to the arguments passed - * to the next <code>Fiber.yield</code> statement inside the fiber's block + * to the next Fiber.yield statement inside the fiber's block * or to the block value if it runs to completion without any - * <code>Fiber.yield</code> + * Fiber.yield */ static VALUE rb_fiber_m_resume(int argc, VALUE *argv, VALUE fib) @@ -1970,7 +1969,7 @@ rb_fiber_m_resume(int argc, VALUE *argv, VALUE fib) * fiber.raise(exception [, string [, array]]) -> obj * * Raises an exception in the fiber at the point at which the last - * <code>Fiber.yield</code> was called, or at the start if neither +resume+ + * Fiber.yield was called, or at the start if neither +resume+ * nor +raise+ were called before. * * With no arguments, raises a +RuntimeError+. With a single +String+ @@ -1996,7 +1995,7 @@ rb_fiber_raise(int argc, VALUE *argv, VALUE fib) * Transfer control to another fiber, resuming it from where it last * stopped or starting it if it was not resumed before. The calling * fiber will be suspended much like in a call to - * <code>Fiber.yield</code>. You need to <code>require 'fiber'</code> + * Fiber.yield. You need to <code>require 'fiber'</code> * before using this method. * * The fiber which receives the transfer call is treats it much like @@ -2048,9 +2047,9 @@ rb_fiber_m_transfer(int argc, VALUE *argv, VALUE fibval) * * Yields control back to the context that resumed the fiber, passing * along any arguments that were passed to it. The fiber will resume - * processing at this point when <code>resume</code> is called next. - * Any arguments passed to the next <code>resume</code> will be the - * value that this <code>Fiber.yield</code> expression evaluates to. + * processing at this point when #resume is called next. + * Any arguments passed to the next #resume will be the value that + * this Fiber.yield expression evaluates to. */ static VALUE rb_fiber_s_yield(int argc, VALUE *argv, VALUE klass) |