implemented backslash for continuation comments
This commit is contained in:
parent
c4c0c41d61
commit
bdf3bee055
6 changed files with 46 additions and 10 deletions
|
|
@ -135,6 +135,16 @@ aligned to the preceding one, it does not start a new comment:
|
|||
# statement.
|
||||
i = i + 1 # This a new comment that is NOT
|
||||
echo(i) # continued here, because this comment refers to the echo statement
|
||||
|
||||
|
||||
The alignment requirement does not hold if the preceding comment piece ends in
|
||||
a backslash (followed by optional whitespace):
|
||||
|
||||
.. code-block:: nimrod
|
||||
type
|
||||
TMyObject {.final, pure, acyclic.} = object # comment continues: \
|
||||
# we have lots of space here to comment 'TMyObject'.
|
||||
# This line belongs to the comment as it's properly aligned.
|
||||
|
||||
Comments are tokens; they are only allowed at certain places in the input file
|
||||
as they belong to the syntax tree! This feature enables perfect source-to-source
|
||||
|
|
|
|||
11
doc/tut1.txt
11
doc/tut1.txt
|
|
@ -130,6 +130,17 @@ comments need to be aligned at the same column:
|
|||
i = i + 1 # This a new comment that is NOT
|
||||
echo(i) # continued here, because this comment refers to the echo statement
|
||||
|
||||
|
||||
The alignment requirement does not hold if the preceding comment piece ends in
|
||||
a backslash:
|
||||
|
||||
.. code-block:: nimrod
|
||||
type
|
||||
TMyObject {.final, pure, acyclic.} = object # comment continues: \
|
||||
# we have lots of space here to comment 'TMyObject'.
|
||||
# This line belongs to the comment as it's properly aligned.
|
||||
|
||||
|
||||
Comments are tokens; they are only allowed at certain places in the input file
|
||||
as they belong to the syntax tree! This feature enables perfect source-to-source
|
||||
transformations (such as pretty-printing) and simpler documentation generators.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue