mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-29 01:14:41 +00:00
small documentation improvements
This commit is contained in:
@@ -2858,9 +2858,9 @@ compatibility:
|
||||
For a routine ``p`` the compiler uses inference rules to determine the set of
|
||||
possibly raised exceptions; the algorithm operates on ``p``'s call graph:
|
||||
|
||||
1. Every indirect call via some proc type ``T`` is assumed to
|
||||
raise ``system.E_Base`` (the base type of the exception hierarchy) and thus
|
||||
any exception unless ``T`` has an explicit ``raises`` list.
|
||||
1. Every indirect call via some proc type ``T`` is assumed to
|
||||
raise ``system.E_Base`` (the base type of the exception hierarchy) and
|
||||
thus any exception unless ``T`` has an explicit ``raises`` list.
|
||||
2. Every call to a proc ``q`` which has an unknown body (due to a forward
|
||||
declaration or an ``importc`` pragma) is assumed to
|
||||
raise ``system.E_Base`` unless ``q`` has an explicit ``raises`` list.
|
||||
@@ -2914,7 +2914,7 @@ effects up to the ``effects``'s position:
|
||||
proc p(what: bool) =
|
||||
if what:
|
||||
raise newException(EIO, "IO")
|
||||
{.effect.}
|
||||
{.effects.}
|
||||
else:
|
||||
raise newException(EOS, "OS")
|
||||
|
||||
@@ -3522,7 +3522,7 @@ BindSym
|
||||
The above ``debug`` macro relies on the fact that ``write``, ``writeln`` and
|
||||
``stdout`` are declared in the system module and thus visible in the
|
||||
instantiating context. There is a way to use bound identifiers
|
||||
(aka `symbols`:idx) instead of using unbound identifiers. The ``bindSym``
|
||||
(aka `symbols`:idx:) instead of using unbound identifiers. The ``bindSym``
|
||||
builtin can be used for that:
|
||||
|
||||
.. code-block:: nimrod
|
||||
@@ -4038,7 +4038,7 @@ ordinary routines.
|
||||
Move optimization
|
||||
-----------------
|
||||
|
||||
The ``call`` constraint is particular useful to implement a `move`:idx:
|
||||
The ``call`` constraint is particularly useful to implement a `move`:idx:
|
||||
optimization for types that have copying semantics:
|
||||
|
||||
.. code-block:: nimrod
|
||||
|
||||
@@ -1012,10 +1012,10 @@ proc whichSection(p: TRstParser): TRstNodeKind =
|
||||
result = rnOptionList
|
||||
else:
|
||||
result = rnParagraph
|
||||
of tkWord, tkOther, tkWhite:
|
||||
of tkWord, tkOther, tkWhite:
|
||||
if match(p, tokenAfterNewLine(p), "ai"): result = rnHeadline
|
||||
elif isDefList(p): result = rnDefList
|
||||
elif match(p, p.idx, "e) ") or match(p, p.idx, "e. "): result = rnEnumList
|
||||
elif isDefList(p): result = rnDefList
|
||||
else: result = rnParagraph
|
||||
else: result = rnLeaf
|
||||
|
||||
|
||||
@@ -390,7 +390,8 @@ proc renderField(d: PDoc, n: PRstNode, result: var string) =
|
||||
if d.target == outLatex:
|
||||
var fieldname = addNodes(n.sons[0])
|
||||
var fieldval = esc(d.target, strip(addNodes(n.sons[1])))
|
||||
if cmpIgnoreStyle(fieldname, "author") == 0:
|
||||
if cmpIgnoreStyle(fieldname, "author") == 0 or
|
||||
cmpIgnoreStyle(fieldname, "authors") == 0:
|
||||
if d.meta[metaAuthor].len == 0:
|
||||
d.meta[metaAuthor] = fieldval
|
||||
b = true
|
||||
|
||||
Reference in New Issue
Block a user