Further tutorial updates (#5176)
* tut1: added multiline comments * tut2: replaced expr/stmt with untyped/typed * added some more template/macro example * remove immediate pragma from example
This commit is contained in:
parent
92ecbc9958
commit
86c73cdfc2
2 changed files with 85 additions and 15 deletions
13
doc/tut1.rst
13
doc/tut1.rst
|
|
@ -125,6 +125,19 @@ Documentation comments are tokens; they are only allowed at certain places in
|
|||
the input file as they belong to the syntax tree! This feature enables simpler
|
||||
documentation generators.
|
||||
|
||||
Multiline comments are started with ``#[`` and terminated with ``]#``. Multiline
|
||||
comments can also be nested.
|
||||
|
||||
.. code-block:: nim
|
||||
#[
|
||||
You can have any Nim code text commented
|
||||
out inside this with no indentation restrictions.
|
||||
yes("May I ask a pointless question?")
|
||||
#[
|
||||
Note: these can be nested!!
|
||||
]#
|
||||
]#
|
||||
|
||||
You can also use the `discard statement`_ together with *long string
|
||||
literals* to create block comments:
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue