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} <#-- GREEN MOUSE -->
}</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><#-- ... --></literal> or as <literal>[#--
+ ... --]</literal>. Example:</para>
+
+ <programlisting role="template"><#assign x <#-- A comment --> = 123 <#-- A comment -->>
+<#function f(x <#-- A comment -->, y <#-- A comment -->)>
+ <#return <#-- A comment --> 1 <#-- A comment -->>
+</#function>
+<#assign someHash = {
+ "foo": 123, <#-- A comment -->
+ "bar": x <#-- A comment --> + 1,
+ <#-- A comment -->
+ "baaz": f(1 <#-- A comment -->, 2 <#-- A comment -->)
+} <#-- A comment -->></programlisting>
+ </section>
+
<section xml:id="dgui_template_exp_precedence">
<title>Operator precedence</title>