mirror of
https://github.com/nim-lang/Nim.git
synced 2026-03-03 23:28:31 +00:00
Merge pull request #473 from gradha/pr_doc_improvements
Doc improvements
This commit is contained in:
16
doc/lib.txt
16
doc/lib.txt
@@ -255,6 +255,22 @@ Parsers
|
||||
This is a low level module that implements an extremely efficient buffering
|
||||
scheme for lexers and parsers. This is used by the diverse parsing modules.
|
||||
|
||||
* `highlite <highlite.html>`_
|
||||
Source highlighter for programming or markup languages. Currently
|
||||
only few languages are supported, other languages may be added.
|
||||
The interface supports one language nested in another.
|
||||
|
||||
* `rst <rst.html>`_
|
||||
This module implements a reStructuredText parser. A large subset
|
||||
is implemented. Some features of the markdown wiki syntax are
|
||||
also supported.
|
||||
|
||||
* `rstast <rstast.html>`_
|
||||
This module implements an AST for the reStructuredText parser.
|
||||
|
||||
* `rstgen <rstgen.html>`_
|
||||
This module implements a generator of HTML/Latex from reStructuredText.
|
||||
|
||||
|
||||
XML Processing
|
||||
--------------
|
||||
|
||||
@@ -1388,7 +1388,7 @@ accesses its environment. If it does so, it has the calling convention
|
||||
Distinct type
|
||||
-------------
|
||||
|
||||
A distinct type is new type derived from a `base type`:idx: that is
|
||||
A `distinct type`:idx: is new type derived from a `base type`:idx: that is
|
||||
incompatible with its base type. In particular, it is an essential property
|
||||
of a distinct type that it **does not** imply a subtype relation between it
|
||||
and its base type. Explicit type conversions from a distinct type to its
|
||||
@@ -1435,7 +1435,7 @@ number without unit; and the same holds for division:
|
||||
This quickly gets tedious. The implementations are trivial and the compiler
|
||||
should not generate all this code only to optimize it away later - after all
|
||||
``+`` for dollars should produce the same binary code as ``+`` for ints.
|
||||
The pragma ``borrow`` has been designed to solve this problem; in principle
|
||||
The pragma `borrow`:idx: has been designed to solve this problem; in principle
|
||||
it generates the above trivial implementations:
|
||||
|
||||
.. code-block:: nimrod
|
||||
|
||||
15
doc/tut1.txt
15
doc/tut1.txt
@@ -1182,6 +1182,21 @@ type and instead write it embedded directly as the type of the first dimension:
|
||||
type
|
||||
TLightTower = array[1..10, array[north..west, TBlinkLights]]
|
||||
|
||||
It is quite frequent to have arrays start at zero, so there's a shortcut syntax
|
||||
to specify a range from zero to the specified index minus one:
|
||||
|
||||
.. code-block:: nimrod
|
||||
type
|
||||
TIntArray = array[0..5, int] # an array that is indexed with 0..5
|
||||
TQuickArray = array[6, int] # an array that is indexed with 0..5
|
||||
var
|
||||
x: TIntArray
|
||||
y: TQuickArray
|
||||
x = [1, 2, 3, 4, 5, 6]
|
||||
y = x
|
||||
for i in low(x)..high(x):
|
||||
echo(x[i], y[i])
|
||||
|
||||
|
||||
Sequences
|
||||
---------
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
# distribution, for details about the copyright.
|
||||
#
|
||||
|
||||
## This module implements a `reStructuredText`:idx parser. A large
|
||||
## This module implements a `reStructuredText`:idx: parser. A large
|
||||
## subset is implemented. Some features of the `markdown`:idx: wiki syntax are
|
||||
## also supported.
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
# distribution, for details about the copyright.
|
||||
#
|
||||
|
||||
## This module implements an AST for the `reStructuredText`:idx parser.
|
||||
## This module implements an AST for the `reStructuredText`:idx: parser.
|
||||
|
||||
import strutils
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
# distribution, for details about the copyright.
|
||||
#
|
||||
|
||||
## This module implements a generator of HTML/Latex from `reStructuredText`:idx.
|
||||
## This module implements a generator of HTML/Latex from `reStructuredText`:idx:.
|
||||
|
||||
import strutils, os, hashes, strtabs, rstast, rst, highlite
|
||||
|
||||
@@ -692,4 +692,4 @@ proc rstToHtml*(s: string, options: TRstParseOptions,
|
||||
var rst = rstParse(s, filen, 0, 1, dummyHasToc, options)
|
||||
result = ""
|
||||
renderRstToOut(d, rst, result)
|
||||
|
||||
|
||||
|
||||
@@ -60,7 +60,9 @@ srcdoc2: "pure/collections/intsets;pure/collections/queues;pure/encodings"
|
||||
srcdoc2: "pure/events;pure/collections/sequtils;pure/irc;pure/cookies"
|
||||
srcdoc2: "pure/ftpclient;pure/memfiles;pure/subexes;pure/collections/critbits"
|
||||
srcdoc2: "pure/asyncio;pure/actors;core/locks;pure/oids;pure/endians;pure/uri"
|
||||
srcdoc2: "pure/nimprof;pure/unittest"
|
||||
srcdoc2: "pure/nimprof;pure/unittest;packages/docutils/highlite"
|
||||
srcdoc2: "packages/docutils/rst;packages/docutils/rstast"
|
||||
srcdoc2: "packages/docutils/rstgen"
|
||||
|
||||
webdoc: "wrappers/libcurl;pure/md5;wrappers/mysql;wrappers/iup"
|
||||
webdoc: "wrappers/sqlite3;wrappers/postgres;wrappers/tinyc"
|
||||
|
||||
Reference in New Issue
Block a user