diff options
author | Araq <rumpf_a@web.de> | 2012-08-23 08:45:40 +0200 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2012-08-23 08:45:40 +0200 |
commit | bdf3bee05510718581510cb78fa70ca183039d55 (patch) | |
tree | 62565e928efae42082004f904c1d4467f51ce013 /doc/tut1.txt | |
parent | c4c0c41d616f1859aa588f50a422aed608df6b77 (diff) | |
download | Nim-bdf3bee05510718581510cb78fa70ca183039d55.tar.gz |
implemented backslash for continuation comments
Diffstat (limited to 'doc/tut1.txt')
-rwxr-xr-x | doc/tut1.txt | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/doc/tut1.txt b/doc/tut1.txt index a5554cffc..833d364df 100755 --- a/doc/tut1.txt +++ b/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. |