Merge pull request #739 from gradha/pr_adds_to_quit_docs
Adds to quit docs
This commit is contained in:
commit
30aef21def
2 changed files with 9 additions and 1 deletions
|
|
@ -4708,7 +4708,11 @@ fatal pragma
|
||||||
------------
|
------------
|
||||||
The `fatal`:idx: pragma is used to make the compiler output an error message
|
The `fatal`:idx: pragma is used to make the compiler output an error message
|
||||||
with the given content. In contrast to the ``error`` pragma, compilation
|
with the given content. In contrast to the ``error`` pragma, compilation
|
||||||
is guaranteed to be aborted by this pragma.
|
is guaranteed to be aborted by this pragma. Example:
|
||||||
|
|
||||||
|
.. code-block:: nimrod
|
||||||
|
when not defined(objc):
|
||||||
|
{.fatal: "Compile this program with the objc command!".}
|
||||||
|
|
||||||
warning pragma
|
warning pragma
|
||||||
--------------
|
--------------
|
||||||
|
|
|
||||||
|
|
@ -923,6 +923,10 @@ proc quit*(errorcode: int = QuitSuccess) {.
|
||||||
## The proc ``quit(QuitSuccess)`` is called implicitly when your nimrod
|
## The proc ``quit(QuitSuccess)`` is called implicitly when your nimrod
|
||||||
## program finishes without incident. A raised unhandled exception is
|
## program finishes without incident. A raised unhandled exception is
|
||||||
## equivalent to calling ``quit(QuitFailure)``.
|
## equivalent to calling ``quit(QuitFailure)``.
|
||||||
|
##
|
||||||
|
## Note that this is a *runtime* call and using ``quit`` inside a macro won't
|
||||||
|
## have any compile time effect. If you need to stop the compiler inside a
|
||||||
|
## macro, use the ``error`` or ``fatal`` pragmas.
|
||||||
|
|
||||||
template sysAssert(cond: bool, msg: string) =
|
template sysAssert(cond: bool, msg: string) =
|
||||||
when defined(useSysAssert):
|
when defined(useSysAssert):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue