You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@freemarker.apache.org by dd...@apache.org on 2017/03/03 20:41:49 UTC

incubator-freemarker git commit: Removed long deprecated <#comment>... directive.

Repository: incubator-freemarker
Updated Branches:
  refs/heads/3 5965bc4a0 -> b67faaa7f


Removed long deprecated <#comment>...</#comment> directive.


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

Branch: refs/heads/3
Commit: b67faaa7f5760b04cec4717c5e7a20855f0b4a6a
Parents: 5965bc4
Author: ddekany <dd...@apache.org>
Authored: Fri Mar 3 21:41:40 2017 +0100
Committer: ddekany <dd...@apache.org>
Committed: Fri Mar 3 21:41:40 2017 +0100

----------------------------------------------------------------------
 .../java/org/apache/freemarker/core/ASTDirective.java    |  2 --
 src/main/javacc/FTL.jj                                   | 11 ++---------
 src/manual/en_US/FM3-CHANGE-LOG.txt                      |  3 ++-
 .../freemarker/test/templatesuite/templates/comment.ftl  |  8 ++++----
 4 files changed, 8 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/b67faaa7/src/main/java/org/apache/freemarker/core/ASTDirective.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/ASTDirective.java b/src/main/java/org/apache/freemarker/core/ASTDirective.java
index 9862d7b..c1bf03f 100644
--- a/src/main/java/org/apache/freemarker/core/ASTDirective.java
+++ b/src/main/java/org/apache/freemarker/core/ASTDirective.java
@@ -54,9 +54,7 @@ abstract class ASTDirective extends ASTElement {
         addName(allNames, lcNames, ccNames, "attempt");
         addName(allNames, lcNames, ccNames, "autoesc", "autoEsc");
         addName(allNames, lcNames, ccNames, "break");
-        addName(allNames, lcNames, ccNames, "call");
         addName(allNames, lcNames, ccNames, "case");
-        addName(allNames, lcNames, ccNames, "comment");
         addName(allNames, lcNames, ccNames, "compress");
         addName(allNames, lcNames, ccNames, "default");
         addName(allNames, lcNames, ccNames, "else");

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/b67faaa7/src/main/javacc/FTL.jj
----------------------------------------------------------------------
diff --git a/src/main/javacc/FTL.jj b/src/main/javacc/FTL.jj
index b66623a..1b419fe 100644
--- a/src/main/javacc/FTL.jj
+++ b/src/main/javacc/FTL.jj
@@ -488,9 +488,8 @@ TOKEN_MGR_DECLS:
 
     /**
      * The noparseTag is set when we enter a block of text that the parser more or less ignores. These are <noparse> and
-     * <comment>. This variable tells us what the closing tag should be, and when we hit that, we resume parsing. Note
-     * that with this scheme, <comment> and <noparse> tags cannot nest recursively, but it is not clear how important
-     * that is.
+     * <#-- ... --->. This variable tells us what the closing tag should be, and when we hit that, we resume parsing.
+     * Note that with this scheme, <noparse> tags and comments cannot nest recursively.
      */
     String noparseTag;
 
@@ -813,10 +812,6 @@ TOKEN:
     |
     <COMPRESS : <START_TAG> "compress" <CLOSE_TAG1>> { handleTagSyntaxAndSwitch(matchedToken, DEFAULT); }
     |
-    <COMMENT : <START_TAG> "comment" <CLOSE_TAG1>> {
-        handleTagSyntaxAndSwitch(matchedToken, NO_PARSE); noparseTag = "comment";
-    }
-    |
     <TERSE_COMMENT : ("<" | "[") "#--" > { noparseTag = "-->"; handleTagSyntaxAndSwitch(matchedToken, NO_PARSE); }
     |
     <NOPARSE: <START_TAG> "no" ("p" | "P") "arse" <CLOSE_TAG1>> {
@@ -3326,8 +3321,6 @@ ASTComment ASTComment() :
 }
 {
     (
-        start = <COMMENT>
-        |
         start = <TERSE_COMMENT>
     )
     end = UnparsedContent(start, buf)

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/b67faaa7/src/manual/en_US/FM3-CHANGE-LOG.txt
----------------------------------------------------------------------
diff --git a/src/manual/en_US/FM3-CHANGE-LOG.txt b/src/manual/en_US/FM3-CHANGE-LOG.txt
index 221d135..b69cb04 100644
--- a/src/manual/en_US/FM3-CHANGE-LOG.txt
+++ b/src/manual/en_US/FM3-CHANGE-LOG.txt
@@ -140,4 +140,5 @@ the FreeMarer 3 changelog here:
     required when calling JSP custom tags/functions, and in FreeMarker 2 this was worked around with using the
     global static default DefaultObjectWrapper when the ObjectWrapper wasn't an ObjectWrapperAndUnwrapper.
 - Removed some long deprecated template language directives:
-  - <call ...>
\ No newline at end of file
+  - <#call ...>
+  - <#comment>...</#comment>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/b67faaa7/src/test/resources/org/apache/freemarker/test/templatesuite/templates/comment.ftl
----------------------------------------------------------------------
diff --git a/src/test/resources/org/apache/freemarker/test/templatesuite/templates/comment.ftl b/src/test/resources/org/apache/freemarker/test/templatesuite/templates/comment.ftl
index deede58..9c47168 100644
--- a/src/test/resources/org/apache/freemarker/test/templatesuite/templates/comment.ftl
+++ b/src/test/resources/org/apache/freemarker/test/templatesuite/templates/comment.ftl
@@ -31,17 +31,17 @@ A more rigorous test, showing that we're not faking it:
 
 ${message@#$%&}
 
---><#-- > --><#-- -> --><#-- -- --><#-- -- > --><#comment> > </#comment><#comment> </#comment </#comment>
+--><#-- > --><#-- -> --><#-- -- --><#-- -- > -->
 <#if message?exists>
 	<p>Message exists!
-	<#comment>
+	<#--
 		...and even generates output!
-	</#comment>
+	-->
 	</p>
 </#if>
 
 a <#-- < --> b
-a <#-- </#comment> - -- --> b
+a <#-- </#noparse> - -- --> b
 
 ${1 + 2 + [#-- c --] <#-- c --> <!-- c --> 3}
 ${<!-- > -> -- #> #] --> 7}