freemarker-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ddek...@apache.org
Subject [1/2] incubator-freemarker git commit: (Converter minor additions)
Date Mon, 17 Jul 2017 19:05:41 GMT
Repository: incubator-freemarker
Updated Branches:
  refs/heads/3 d0f34dcc1 -> 23341885a


(Converter minor additions)


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

Branch: refs/heads/3
Commit: 5a46ad37dade8eb45e9d471bd849b340537b6289
Parents: d0f34dc
Author: ddekany <ddekany@apache.org>
Authored: Mon Jul 17 15:26:31 2017 +0200
Committer: ddekany <ddekany@apache.org>
Committed: Mon Jul 17 15:31:39 2017 +0200

----------------------------------------------------------------------
 .../main/java/freemarker/core/FM2ASTToFM3SourceConverter.java  | 6 +++---
 .../java/org/freemarker/converter/FM2ToFM3ConverterTest.java   | 3 +--
 2 files changed, 4 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/5a46ad37/freemarker-converter/src/main/java/freemarker/core/FM2ASTToFM3SourceConverter.java
----------------------------------------------------------------------
diff --git a/freemarker-converter/src/main/java/freemarker/core/FM2ASTToFM3SourceConverter.java
b/freemarker-converter/src/main/java/freemarker/core/FM2ASTToFM3SourceConverter.java
index 3117ec2..04166e8 100644
--- a/freemarker-converter/src/main/java/freemarker/core/FM2ASTToFM3SourceConverter.java
+++ b/freemarker-converter/src/main/java/freemarker/core/FM2ASTToFM3SourceConverter.java
@@ -1183,13 +1183,13 @@ public class FM2ASTToFM3SourceConverter {
         Expression callee = getParam(node, 0, ParameterRole.CALLEE, Expression.class);
         printExp(callee);
 
-        int calleEnd = getEndPositionExclusive(callee);
-        int lastParamEnd = printWSAndExpComments(calleEnd);
+        int calleeEnd = getEndPositionExclusive(callee);
+        int lastParamEnd = printWSAndExpComments(calleeEnd);
         boolean legacyCallDirWithParenthesis = false;
         boolean legacyCallDirNeedsSeparatorSpace = false;
         if (legacyCallDirMode) {
             if (src.charAt(lastParamEnd) == '(') {
-                if (calleEnd == lastParamEnd) {
+                if (calleeEnd == lastParamEnd) {
                     legacyCallDirNeedsSeparatorSpace = true;
                 }
                 lastParamEnd++; // skip '('

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/5a46ad37/freemarker-converter/src/test/java/org/freemarker/converter/FM2ToFM3ConverterTest.java
----------------------------------------------------------------------
diff --git a/freemarker-converter/src/test/java/org/freemarker/converter/FM2ToFM3ConverterTest.java
b/freemarker-converter/src/test/java/org/freemarker/converter/FM2ToFM3ConverterTest.java
index 5915476..3660262 100644
--- a/freemarker-converter/src/test/java/org/freemarker/converter/FM2ToFM3ConverterTest.java
+++ b/freemarker-converter/src/test/java/org/freemarker/converter/FM2ToFM3ConverterTest.java
@@ -127,18 +127,17 @@ public class FM2ToFM3ConverterTest extends ConverterTest {
         assertConvertedSame("${a<#--1--><<#--2-->b}${a<#--3--><=<#--4-->b}"
                 + "${(a<#--7-->><#--8-->b)}${(a<#--9-->>=<#--A-->b)}"
                 + "${a<#--B-->==<#--C-->b}${a<#--D-->!=<#--E-->b}");
-        // "Same" for now, will be different later.
         assertConverted("${a == b}${a == b}", "${a = b}${a == b}");
         assertConvertedSame("${a &lt; b}${a lt b}${a \\lt b}");
         assertConvertedSame("${a &lt;= b}${a lte b}${a \\lte b}");
         assertConvertedSame("${a &gt; b}${a gt b}${a \\gt b}");
         assertConvertedSame("${a &gt;= b}${a gte b}${a \\gte b}");
 
-        // [FM3] Add \and and &amp;&amp; tests when 2.3.27 is released
         assertConverted("${a && b}${a && b}${a || b}${a || b}", "${a &&
b}${a & b}${a || b}${a | b}");
         assertConverted(
                 "${a<#--1-->&&<#--2-->b}${a<#--3-->&&<#--4-->b}${a<#--5-->||<#--6-->b}${a<#--7-->||<#--8-->b}",
                 "${a<#--1-->&&<#--2-->b}${a<#--3-->&<#--4-->b}${a<#--5-->||<#--6-->b}${a<#--7-->|<#--8-->b}");
+        assertConvertedSame("${a &amp;&amp; b}${a \\and b}");
 
         assertConvertedSame("${!a}${! foo}${! <#--1--> bar}${!!c}");
 


Mime
View raw message