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:
jlp765 2017-01-07 18:18:45 +10:00 • committed by Andreas Rumpf
commit 86c73cdfc2
2 changed files with 85 additions and 15 deletions

View file

@ -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: