freemarker-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ddek...@apache.org
Subject [14/14] incubator-freemarker git commit: Merge remote-tracking branch 'origin/2.3-gae'
Date Sun, 04 Oct 2015 14:49:39 GMT
Merge remote-tracking branch 'origin/2.3-gae'


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

Branch: refs/heads/master
Commit: e8f8ac85f852f253cad0af45643cdd7cfd59e24a
Parents: 09b10ce 1e905a4
Author: ddekany <ddekany@apache.org>
Authored: Sun Oct 4 16:46:26 2015 +0200
Committer: ddekany <ddekany@apache.org>
Committed: Sun Oct 4 16:46:26 2015 +0200

----------------------------------------------------------------------
 README.txt                                      |   4 +-
 .../freemarker/core/AddConcatExpression.java    |  32 +---
 src/main/java/freemarker/core/BuiltIn.java      |   3 +-
 .../core/BuiltInsForMultipleTypes.java          |  24 ++-
 .../java/freemarker/core/DollarVariable.java    |  10 +-
 src/main/java/freemarker/core/EvalUtil.java     |  28 +++-
 .../java/freemarker/core/Interpolation.java     |   9 ++
 .../java/freemarker/core/NumericalOutput.java   |  18 ++-
 .../java/freemarker/core/ParameterRole.java     |   1 +
 .../java/freemarker/core/StringLiteral.java     | 105 +++++++-----
 src/main/javacc/FTL.jj                          | 139 +++++++++++++---
 src/manual/book.xml                             | 158 +++++++++++--------
 .../freemarker/core/CoercionToTextualTest.java  | 119 ++++++++++++++
 .../freemarker/core/CorectionToTextualTest.java | 119 --------------
 .../java/freemarker/core/DateFormatTest.java    |  19 ++-
 .../java/freemarker/core/NumberFormatTest.java  |   4 +-
 .../java/freemarker/core/OutputFormatTest.java  |  32 +++-
 .../core/ParsingErrorMessagesTest.java          |   7 +
 .../core/StringLiteralInterpolationTest.java    |  77 ++++++++-
 src/test/java/freemarker/test/TemplateTest.java |   6 +-
 src/test/resources/freemarker/core/ast-1.ast    |  19 +--
 .../resources/freemarker/core/ast-builtins.ast  |   3 -
 .../resources/freemarker/core/ast-range.ast     |   2 -
 .../freemarker/core/ast-strlitinterpolation.ast |  72 +++++++--
 .../freemarker/core/ast-strlitinterpolation.ftl |   8 +-
 .../AutoEscapingExample-stringLiteral2.ftlh     |   2 +-
 .../AutoEscapingExample-stringLiteral2.ftlh.out |   2 +-
 27 files changed, 677 insertions(+), 345 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/e8f8ac85/src/main/java/freemarker/core/BuiltIn.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/e8f8ac85/src/main/java/freemarker/core/BuiltInsForMultipleTypes.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/e8f8ac85/src/main/java/freemarker/core/EvalUtil.java
----------------------------------------------------------------------
diff --cc src/main/java/freemarker/core/EvalUtil.java
index 243304a,886308c..c716a54
--- a/src/main/java/freemarker/core/EvalUtil.java
+++ b/src/main/java/freemarker/core/EvalUtil.java
@@@ -531,10 -557,10 +557,10 @@@ class EvalUtil 
      /**
       * Returns an {@link ArithmeticEngine} even if {@code env} is {@code null}, because
we are in parsing phase.
       */
-     public static ArithmeticEngine getArithmeticEngine(Environment env, TemplateObject tObj)
{
+     static ArithmeticEngine getArithmeticEngine(Environment env, TemplateObject tObj) {
          return env != null
                  ? env.getArithmeticEngine()
 -                : tObj.getTemplate().getParserConfiguration().getArithmeticEngine();
 +                : tObj.getUnboundTemplate().getParserConfiguration().getArithmeticEngine();
      }
      
  }

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/e8f8ac85/src/main/java/freemarker/core/StringLiteral.java
----------------------------------------------------------------------
diff --cc src/main/java/freemarker/core/StringLiteral.java
index bdb5a8e,aa32d3e..91c429a
--- a/src/main/java/freemarker/core/StringLiteral.java
+++ b/src/main/java/freemarker/core/StringLiteral.java
@@@ -19,13 -19,12 +19,11 @@@
  
  package freemarker.core;
  
- import java.io.IOException;
  import java.io.StringReader;
- import java.util.Enumeration;
+ import java.util.List;
  
  import freemarker.template.SimpleScalar;
 -import freemarker.template.Template;
  import freemarker.template.TemplateException;
- import freemarker.template.TemplateExceptionHandler;
  import freemarker.template.TemplateModel;
  import freemarker.template.TemplateScalarModel;
  import freemarker.template.utility.StringUtil;
@@@ -44,11 -45,12 +44,12 @@@ final class StringLiteral extends Expre
       *            The token source of the template that contains this string literal. As
of this writing, we only need
       *            this to share the {@code namingConvetion} with that.
       */
-     // TODO This should be the part of the "parent" parsing; now it contains hacks like
those with namingConvention.  
-     void parseValue(FMParserTokenManager parentTkMan) throws ParseException {
+     void parseValue(FMParserTokenManager parentTkMan, OutputFormat outputFormat) throws
ParseException {
+         // The way this work is incorrect (the literal should be parsed without un-escaping),
+         // but we can't fix this backward compatibly.
          if (value.length() > 3 && (value.indexOf("${") >= 0 || value.indexOf("#{")
>= 0)) {
              
 -            Template parentTemplate = getTemplate();
 +            UnboundTemplate parentTemplate = getUnboundTemplate();
  
              try {
                  FMParserTokenManager tkMan = new FMParserTokenManager(
@@@ -57,11 -59,11 +58,11 @@@
                                  beginLine, beginColumn + 1,
                                  value.length()));
                  
 -                FMParser parser = new FMParser(parentTemplate, false, tkMan, parentTemplate.getParserConfiguration());
 +                FMParser parser = new FMParser(parentTemplate, false, tkMan, null, parentTemplate.getParserConfiguration());
                  // We continue from the parent parser's current state:
-                 parser.setupStringLiteralMode(parentTkMan);
+                 parser.setupStringLiteralMode(parentTkMan, outputFormat);
                  try {
-                     dynamicValue = parser.FreeMarkerText();
+                     dynamicValue = parser.StaticTextAndInterpolations();
                  } finally {
                      // The parent parser continues from this parser's current state:
                      parser.tearDownStringLiteralMode(parentTkMan);

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/e8f8ac85/src/main/javacc/FTL.jj
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/e8f8ac85/src/test/resources/freemarker/core/ast-1.ast
----------------------------------------------------------------------


Mime
View raw message