summary refs log tree commit diff stats
path: root/doc
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2012-08-23 08:45:40 +0200
committerAraq <rumpf_a@web.de>2012-08-23 08:45:40 +0200
commitbdf3bee05510718581510cb78fa70ca183039d55 (patch)
tree62565e928efae42082004f904c1d4467f51ce013 /doc
parentc4c0c41d616f1859aa588f50a422aed608df6b77 (diff)
downloadNim-bdf3bee05510718581510cb78fa70ca183039d55.tar.gz
implemented backslash for continuation comments
Diffstat (limited to 'doc')
-rwxr-xr-xdoc/manual.txt10
-rwxr-xr-xdoc/tut1.txt11
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.