freemarker-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ddek...@apache.org
Subject [2/2] incubator-freemarker git commit: Fixed exp! end position bug when it's before namedParam=value
Date Thu, 26 Oct 2017 23:03:58 GMT
Fixed exp! end position bug when it's before namedParam=value


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

Branch: refs/heads/2.3-gae
Commit: a49897366395a6796e48139704d82b693465b0fa
Parents: 8be28d1
Author: ddekany <ddekany@apache.org>
Authored: Fri Oct 27 01:03:47 2017 +0200
Committer: ddekany <ddekany@apache.org>
Committed: Fri Oct 27 01:03:47 2017 +0200

----------------------------------------------------------------------
 src/main/javacc/FTL.jj | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/a4989736/src/main/javacc/FTL.jj
----------------------------------------------------------------------
diff --git a/src/main/javacc/FTL.jj b/src/main/javacc/FTL.jj
index 0d07789..111ec89 100644
--- a/src/main/javacc/FTL.jj
+++ b/src/main/javacc/FTL.jj
@@ -2085,7 +2085,8 @@ Expression DefaultTo(Expression exp) :
     {
         DefaultToExpression result = new DefaultToExpression(exp, rhs);
         if (rhs == null) {
-            result.setLocation(template, exp, t);
+            // <TERMINATING_EXCLAM> contains the whitespace after the `!`, so we have
to use the t.beginXxx:
+            result.setLocation(template, exp.beginColumn, exp.beginLine, t.beginColumn, t.beginLine);
         } else {
             result.setLocation(template, exp, rhs);
         }


Mime
View raw message