You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@freemarker.apache.org by wo...@apache.org on 2017/10/16 01:34:14 UTC

[2/8] incubator-freemarker git commit: Manual: Documented comment usage inside expressions

Manual: Documented comment usage inside expressions


Project: http://git-wip-us.apache.org/repos/asf/incubator-freemarker/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-freemarker/commit/1cb67f87
Tree: http://git-wip-us.apache.org/repos/asf/incubator-freemarker/tree/1cb67f87
Diff: http://git-wip-us.apache.org/repos/asf/incubator-freemarker/diff/1cb67f87

Branch: refs/heads/2.3
Commit: 1cb67f87c3f1fc4337d8a2b8cf4499c1ac177d2e
Parents: e726cd2
Author: ddekany <dd...@apache.org>
Authored: Sat Oct 14 22:21:28 2017 +0200
Committer: ddekany <dd...@apache.org>
Committed: Sat Oct 14 22:21:28 2017 +0200

----------------------------------------------------------------------
 src/manual/en_US/book.xml | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/1cb67f87/src/manual/en_US/book.xml
----------------------------------------------------------------------
diff --git a/src/manual/en_US/book.xml b/src/manual/en_US/book.xml
index 1e0e4d9..3d74ed3 100644
--- a/src/manual/en_US/book.xml
+++ b/src/manual/en_US/book.xml
@@ -4035,6 +4035,27 @@ ${("green " + "mouse")?upper_case}  &lt;#-- GREEN MOUSE --&gt;
       }</programlisting>
         </section>
 
+        <section xml:id="dgui_template_exp_comment">
+          <title>Comments in expressions</title>
+
+          <para>Expression may contain comments anywhere where they can
+          contain ignored white-space (<link
+          linkend="dgui_template_exp_whitespace">see above</link>). Comments
+          look like <literal>&lt;#-- ... --&gt;</literal> or as <literal>[#--
+          ... --]</literal>. Example:</para>
+
+          <programlisting role="template">&lt;#assign x &lt;#-- A comment --&gt; = 123 &lt;#-- A comment --&gt;&gt;
+&lt;#function f(x &lt;#-- A comment --&gt;, y &lt;#-- A comment --&gt;)&gt;
+  &lt;#return &lt;#-- A comment --&gt; 1 &lt;#-- A comment --&gt;&gt;
+&lt;/#function&gt;
+&lt;#assign someHash = {
+    "foo": 123, &lt;#-- A comment --&gt;
+    "bar": x &lt;#-- A comment --&gt; + 1,
+    &lt;#-- A comment --&gt;
+    "baaz": f(1 &lt;#-- A comment --&gt;, 2 &lt;#-- A comment --&gt;)
+} &lt;#-- A comment --&gt;&gt;</programlisting>
+        </section>
+
         <section xml:id="dgui_template_exp_precedence">
           <title>Operator precedence</title>