Merge pull request #473 from gradha/pr_doc_improvements
Doc improvements
This commit is contained in:
commit
c5e07af902
7 changed files with 40 additions and 7 deletions
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
|
||||
---------
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue