#else and #elseif tags must be ended without "/", for example, <#else/> is illegal now, <#else> is legal.
Project: http://git-wip-us.apache.org/repos/asf/incubator-freemarker/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-freemarker/commit/eb56a9b6 Tree: http://git-wip-us.apache.org/repos/asf/incubator-freemarker/tree/eb56a9b6 Diff: http://git-wip-us.apache.org/repos/asf/incubator-freemarker/diff/eb56a9b6 Branch: refs/heads/3 Commit: eb56a9b6c69678e855320f92e3ae96d13db336d3 Parents: 600b785 Author: ddekany <[email protected]> Authored: Mon Jul 10 01:18:22 2017 +0200 Committer: ddekany <[email protected]> Committed: Mon Jul 10 01:18:22 2017 +0200 ---------------------------------------------------------------------- FM3-CHANGE-LOG.txt | 5 ++++- freemarker-core/src/main/javacc/FTL.jj | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/eb56a9b6/FM3-CHANGE-LOG.txt ---------------------------------------------------------------------- diff --git a/FM3-CHANGE-LOG.txt b/FM3-CHANGE-LOG.txt index 058459b..1791868 100644 --- a/FM3-CHANGE-LOG.txt +++ b/FM3-CHANGE-LOG.txt @@ -297,4 +297,7 @@ the FreeMarer 3 changelog here: - You can't close #attempt/#recover with `</#recover>` anymore, only with `<#attempt>`. This was the standard form in FM2 as well, and is consistent with how #if/#else works. (The template converter tool does this conversion.) -- Inside a #switch, #case can't be after #default anymore (this is actually a bug in FM2) \ No newline at end of file +- Inside a #switch, #case can't be after #default anymore (this is actually a bug in FM2) + (The template converter can't fix this automatically, but reports it as an error.) +- #else and #elseif tags must be ended without "/", for example, <#else/> is illegal now, <#else> is legal. + (The template converter tool does this conversion.) \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/eb56a9b6/freemarker-core/src/main/javacc/FTL.jj ---------------------------------------------------------------------- diff --git a/freemarker-core/src/main/javacc/FTL.jj b/freemarker-core/src/main/javacc/FTL.jj index 4b4e06a..6b7893c 100644 --- a/freemarker-core/src/main/javacc/FTL.jj +++ b/freemarker-core/src/main/javacc/FTL.jj @@ -833,7 +833,7 @@ TOKEN: | <END_SWITCH : <END_TAG> "switch" <CLOSE_TAG1>> { handleTagSyntaxAndSwitch(matchedToken, DEFAULT); } | - <ELSE : <START_TAG> "else" <CLOSE_TAG2>> { handleTagSyntaxAndSwitch(matchedToken, DEFAULT); } + <ELSE : <START_TAG> "else" <CLOSE_TAG1>> { handleTagSyntaxAndSwitch(matchedToken, DEFAULT); } | <BREAK : <START_TAG> "break" <CLOSE_TAG2>> { handleTagSyntaxAndSwitch(matchedToken, DEFAULT); } | @@ -2225,7 +2225,7 @@ ASTElement If() : ( t = <ELSE_IF> condition = ASTExpression() - end = LooseDirectiveEnd() + end = <DIRECTIVE_END> children = MixedContentElements() { cblock = new ASTDirIfOrElseOrElseIf(condition, children, ASTDirIfOrElseOrElseIf.TYPE_ELSE_IF);
