summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorSimon Ruderich <simon@ruderich.org>2016-09-17 15:52:36 +0200
committerSimon Ruderich <simon@ruderich.org>2016-09-17 15:53:12 +0200
commita9e796e00123150fbb7e4b951670fda2e41161ed (patch)
tree8c4b2e85916ac57b394682c56745197e334c8212
parent5bf16439e1eddb93b4c9177530ca6640a32de42b (diff)
downloadNim-a9e796e00123150fbb7e4b951670fda2e41161ed.tar.gz
Misc documentation fixes
-rw-r--r--doc/manual/lexing.txt4
-rw-r--r--doc/manual/procs.txt10
-rw-r--r--doc/manual/stmts.txt4
-rw-r--r--doc/manual/syntax.txt3
-rw-r--r--doc/manual/templates.txt6
-rw-r--r--doc/manual/type_sections.txt2
-rw-r--r--doc/manual/types.txt8
-rw-r--r--doc/sets_fragment.txt4
-rw-r--r--lib/system.nim13
9 files changed, 27 insertions, 27 deletions
diff --git a/doc/manual/lexing.txt b/doc/manual/lexing.txt
index 4d03023c3..7ffd5eb1c 100644
--- a/doc/manual/lexing.txt
+++ b/doc/manual/lexing.txt
@@ -28,7 +28,7 @@ The parser uses a stack of indentation levels: the stack consists of integers
 counting the spaces. The indentation information is queried at strategic
 places in the parser but ignored otherwise: The pseudo terminal ``IND{>}``
 denotes an indentation that consists of more spaces than the entry at the top
-of the stack; IND{=} an indentation that has the same number of spaces. ``DED``
+of the stack; ``IND{=}`` an indentation that has the same number of spaces. ``DED``
 is another pseudo terminal that describes the *action* of popping a value
 from the stack, ``IND{>}`` then implies to push onto the stack.
 
@@ -399,7 +399,7 @@ These keywords are also operators:
 `=`:tok:, `:`:tok:, `::`:tok: are not available as general operators; they
 are used for other notational purposes.
 
-``*:`` is as a special case the two tokens `*`:tok: and `:`:tok:
+``*:`` is as a special case treated as the two tokens `*`:tok: and `:`:tok:
 (to support ``var v*: T``).
 
 
diff --git a/doc/manual/procs.txt b/doc/manual/procs.txt
index ea6866845..181b1b1e5 100644
--- a/doc/manual/procs.txt
+++ b/doc/manual/procs.txt
@@ -61,14 +61,14 @@ Calling a procedure can be done in many different ways:
 .. code-block:: nim
   proc callme(x, y: int, s: string = "", c: char, b: bool = false) = ...
 
-  # call with positional arguments # parameter bindings:
-  callme(0, 1, "abc", '\t', true)  # (x=0, y=1, s="abc", c='\t', b=true)
+  # call with positional arguments      # parameter bindings:
+  callme(0, 1, "abc", '\t', true)       # (x=0, y=1, s="abc", c='\t', b=true)
   # call with named and positional arguments:
-  callme(y=1, x=0, "abd", '\t')    # (x=0, y=1, s="abd", c='\t', b=false)
+  callme(y=1, x=0, "abd", '\t')         # (x=0, y=1, s="abd", c='\t', b=false)
   # call with named arguments (order is not relevant):
-  callme(c='\t', y=1, x=0)         # (x=0, y=1, s="", c='\t', b=false)
+  callme(c='\t', y=1, x=0)              # (x=0, y=1, s="", c='\t', b=false)
   # call as a command statement: no () needed:
-  callme 0, 1, "abc", '\t'
+  callme 0, 1, "abc", '\t'              # (x=0, y=1, s="abc", c='\t', b=false)
 
 A procedure may call itself recursively.
 
diff --git a/doc/manual/stmts.txt b/doc/manual/stmts.txt
index 318738063..fa1cac8e1 100644
--- a/doc/manual/stmts.txt
+++ b/doc/manual/stmts.txt
@@ -462,10 +462,10 @@ While statement
 Example:
 
 .. code-block:: nim
-  echo "Please tell me your password: \n"
+  echo "Please tell me your password:"
   var pw = readLine(stdin)
   while pw != "12345":
-    echo "Wrong password! Next try: \n"
+    echo "Wrong password! Next try:"
     pw = readLine(stdin)
 
 
diff --git a/doc/manual/syntax.txt b/doc/manual/syntax.txt
index 89f8ca707..f3ace9f56 100644
--- a/doc/manual/syntax.txt
+++ b/doc/manual/syntax.txt
@@ -62,7 +62,8 @@ Precedence level    Operators                                      First charact
 ================  ===============================================  ==================  ===============
 
 
-Whether an operator is used a prefix operator is also affected by preceeding whitespace (this parsing change was introduced with version 0.13.0):
+Whether an operator is used a prefix operator is also affected by preceding
+whitespace (this parsing change was introduced with version 0.13.0):
 
 .. code-block:: nim
   echo $foo
diff --git a/doc/manual/templates.txt b/doc/manual/templates.txt
index be5c6fa18..f01a703cd 100644
--- a/doc/manual/templates.txt
+++ b/doc/manual/templates.txt
@@ -406,11 +406,11 @@ builtin can be used for that:
 
   macro debug(n: varargs[typed]): untyped =
     result = newNimNode(nnkStmtList, n)
-    for i in 0..n.len-1:
+    for x in n:
       # we can bind symbols in scope via 'bindSym':
-      add(result, newCall(bindSym"write", bindSym"stdout", toStrLit(n[i])))
+      add(result, newCall(bindSym"write", bindSym"stdout", toStrLit(x)))
       add(result, newCall(bindSym"write", bindSym"stdout", newStrLitNode(": ")))
-      add(result, newCall(bindSym"writeLine", bindSym"stdout", n[i]))
+      add(result, newCall(bindSym"writeLine", bindSym"stdout", x))
 
   var
     a: array [0..10, int]
diff --git a/doc/manual/type_sections.txt b/doc/manual/type_sections.txt
index 34bbe6bd5..af761c77e 100644
--- a/doc/manual/type_sections.txt
+++ b/doc/manual/type_sections.txt
@@ -13,7 +13,7 @@ Example:
     Sym = object       # a symbol
       name: string     # the symbol's name
       line: int        # the line the symbol was declared in
-      code: Node      # the symbol's abstract syntax tree
+      code: Node       # the symbol's abstract syntax tree
 
 A type section begins with the ``type`` keyword. It contains multiple
 type definitions. A type definition binds a type to a name. Type definitions
diff --git a/doc/manual/types.txt b/doc/manual/types.txt
index d6495dbc3..02426e0d9 100644
--- a/doc/manual/types.txt
+++ b/doc/manual/types.txt
@@ -227,8 +227,8 @@ floating pointer values at compile time; this means expressions like
 Boolean type
 ------------
 The boolean type is named `bool`:idx: in Nim and can be one of the two
-pre-defined values ``true`` and ``false``. Conditions in while,
-if, elif, when statements need to be of type bool.
+pre-defined values ``true`` and ``false``. Conditions in ``while``,
+``if``, ``elif``, ``when``-statements need to be of type ``bool``.
 
 This condition holds::
 
@@ -609,7 +609,7 @@ is similar to the ``instanceof`` operator in Java.
       age: int        # no * means that the field is hidden
 
     Student = ref object of Person # a student is a person
-      id: int                  # with an id field
+      id: int                      # with an id field
 
   var
     student: Student
@@ -1262,4 +1262,4 @@ Is the same as:
 
 However later versions of the language might change this to mean "infer the
 parameters' types from the body". Then the above ``foo`` would be rejected as
-the parameters' types can not be infered from an empty ``discard`` statement.
+the parameters' types can not be inferred from an empty ``discard`` statement.
diff --git a/doc/sets_fragment.txt b/doc/sets_fragment.txt
index a6fe7555d..435807e1a 100644
--- a/doc/sets_fragment.txt
+++ b/doc/sets_fragment.txt
@@ -1,5 +1,5 @@
-The set type models the mathematical notion of a set. The set's
-basetype can only be an ordinal type of a certain size, namely:
+The set type models the mathematical notion of a set. The set's basetype can
+only be an ordinal type of a certain size, namely:
   * ``int8``-``int16``
   * ``uint8``/``byte``-``uint16``
   * ``char``
diff --git a/lib/system.nim b/lib/system.nim
index 16258988f..31d14d4bf 100644
--- a/lib/system.nim
+++ b/lib/system.nim
@@ -1521,7 +1521,7 @@ type # these work for most platforms:
     ## This is the same as the type ``double`` in *C*.
   clongdouble* {.importc: "long double", nodecl.} = BiggestFloat
     ## This is the same as the type ``long double`` in *C*.
-    ## This C type is not supported by Nim's code generator
+    ## This C type is not supported by Nim's code generator.
 
   cuchar* {.importc: "unsigned char", nodecl.} = char
     ## This is the same as the type ``unsigned char`` in *C*.
@@ -2653,12 +2653,11 @@ when not defined(JS): #and not defined(nimscript):
 
   when defined(nimscript):
     proc readFile*(filename: string): string {.tags: [ReadIOEffect], benign.}
-      ## Opens a file named `filename` for reading.
-      ##
-      ## Then calls `readAll <#readAll>`_ and closes the file afterwards.
-      ## Returns the string.  Raises an IO exception in case of an error. If
-      ## you need to call this inside a compile time macro you can use
-      ## `staticRead <#staticRead>`_.
+      ## Opens a file named `filename` for reading, calls `readAll
+      ## <#readAll>`_ and closes the file afterwards. Returns the string.
+      ## Raises an IO exception in case of an error. If # you need to call
+      ## this inside a compile time macro you can use `staticRead
+      ## <#staticRead>`_.
 
     proc writeFile*(filename, content: string) {.tags: [WriteIOEffect], benign.}
       ## Opens a file named `filename` for writing. Then writes the