diff options
| author | Graydon Hoare <[email protected]> | 2010-07-12 15:14:27 -0700 |
|---|---|---|
| committer | Graydon Hoare <[email protected]> | 2010-07-12 15:14:27 -0700 |
| commit | 5860a255488b5a15f13c044ec6ab39116ce53093 (patch) | |
| tree | 207c42e251530d2c90e5cd872992dc7ee9e27119 | |
| parent | Wrap long line. (diff) | |
| parent | Fix typos in the docs. (diff) | |
| download | rust-5860a255488b5a15f13c044ec6ab39116ce53093.tar.xz rust-5860a255488b5a15f13c044ec6ab39116ce53093.zip | |
Merge branch 'contrib'
| -rw-r--r-- | doc/rust.texi | 22 | ||||
| -rw-r--r-- | src/boot/fe/ast.ml | 6 |
2 files changed, 14 insertions, 14 deletions
diff --git a/doc/rust.texi b/doc/rust.texi index eec63a72..4b2689df 100644 --- a/doc/rust.texi +++ b/doc/rust.texi @@ -2089,7 +2089,7 @@ Vectors can be sliced. A slice expression builds a new vector by copying a contiguous range -- given by a pair of indices representing a half-open interval -- out of the sliced vector. -And example of a @code{vec} type and its use: +An example of a @code{vec} type and its use: @example let vec[int] v = vec(7, 5, 3); let int i = v.(2); @@ -2698,9 +2698,9 @@ following the declaration statement. The latter (@code{auto}) form of slot declaration causes the compiler to infer the static type of the slot through unification with the types of values -assigned to the slot in the the remaining code in the block scope. Inference -only occurs on frame-local slots, not argument slots. Function, iterator and -object signatures must always declared types for all argument slots. +assigned to the slot in the remaining code in the block scope. Inference only +occurs on frame-local slots, not argument slots. Function, iterator and object +signatures must always declared types for all argument slots. @xref{Ref.Mem.Slot}. @@ -2718,11 +2718,11 @@ Executing a copy statement causes the value denoted by the expression -- either a value or a primitive combination of values -- to be copied into the memory location denoted by the @emph{lval}. -A copy may entail the the adjustment of reference counts, execution of -destructors, or similar adjustments in order to respect the path through the -memory graph implied by the @code{lval}, as well as any existing value held in -the memory being written-to. All such adjustment is automatic and implied by -the @code{=} operator. +A copy may entail the adjustment of reference counts, execution of destructors, +or similar adjustments in order to respect the path through the memory graph +implied by the @code{lval}, as well as any existing value held in the memory +being written-to. All such adjustment is automatic and implied by the @code{=} +operator. An example of three different copy statements: @example @@ -2740,7 +2740,7 @@ A @code{spawn} statement consists of keyword @code{spawn}, followed by a normal @emph{call} statement (@pxref{Ref.Stmt.Call}). A @code{spawn} statement causes the runtime to construct a new task executing the called function. The called function is referred to as the @dfn{entry function} for -the spawned task, and its arguments are copied form the spawning task to the +the spawned task, and its arguments are copied from the spawning task to the spawned task before the spawned task begins execution. Functions taking alias-slot arguments, or returning non-nil values, cannot be @@ -3129,7 +3129,7 @@ variable, executing the loop body once per copy. To perform a for loop on a sub-range of a vector or string, form a temporary slice over the sub-range and run the loop over the slice. -Example of a 4 for loops, all identical: +Example of 4 for loops, all identical: @example let vec[foo] v = vec(a, b, c); diff --git a/src/boot/fe/ast.ml b/src/boot/fe/ast.ml index 25048d07..0b74da3c 100644 --- a/src/boot/fe/ast.ml +++ b/src/boot/fe/ast.ml @@ -1123,17 +1123,17 @@ and fmt_stmt_body (ff:Format.formatter) (s:stmt) : unit = fmt_slot ff slot.node; fmt ff " "; fmt_ident ff ident; - fmt ff " = "; + fmt ff " in "; fmt_lval ff f; fmt_atoms ff az; - fmt ff " "; + fmt ff ") "; fmt_obr ff; fmt_stmts ff sf.for_each_body.node; fmt_cbb ff end | STMT_put (atom) -> - fmt ff "put "; + fmt ff "put"; begin match atom with Some a -> (fmt ff " "; fmt_atom ff a) |