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 | |
parent | c4c0c41d616f1859aa588f50a422aed608df6b77 (diff) | |
download | Nim-bdf3bee05510718581510cb78fa70ca183039d55.tar.gz |
implemented backslash for continuation comments
Diffstat (limited to 'doc')
-rwxr-xr-x | doc/manual.txt | 10 | ||||
-rwxr-xr-x | doc/tut1.txt | 11 |
2 files changed, 21 insertions, 0 deletions
diff --git a/doc/manual.txt b/doc/manual.txt index 07be0c492..ee275fbce 100755 --- a/doc/manual.txt +++ b/doc/manual.txt @@ -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 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. |