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/08/20 21:57:22 UTC

[1/2] incubator-freemarker git commit: (Fixed some parser error message oversights.)

Repository: incubator-freemarker
Updated Branches:
  refs/heads/2.3-gae 94a3c9998 -> 05dc3856c


(Fixed some parser error message oversights.)


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

Branch: refs/heads/2.3-gae
Commit: 61902c38b25d9a1bd51d4e65b759e80ee4f09071
Parents: 94a3c99
Author: ddekany <dd...@apache.org>
Authored: Sun Aug 20 23:56:41 2017 +0200
Committer: ddekany <dd...@apache.org>
Committed: Sun Aug 20 23:56:41 2017 +0200

----------------------------------------------------------------------
 src/main/javacc/FTL.jj | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/61902c38/src/main/javacc/FTL.jj
----------------------------------------------------------------------
diff --git a/src/main/javacc/FTL.jj b/src/main/javacc/FTL.jj
index 2963a41..b7bdd48 100644
--- a/src/main/javacc/FTL.jj
+++ b/src/main/javacc/FTL.jj
@@ -1795,10 +1795,10 @@ Expression EqualityExpression() :
         )
         rhs = RelationalExpression()
         {
-	        notHashLiteral(lhs, "scalar");
-	        notHashLiteral(rhs, "scalar");
-	        notListLiteral(lhs, "scalar");
-	        notListLiteral(rhs, "scalar");
+	        notHashLiteral(lhs, "string");
+	        notHashLiteral(rhs, "string");
+	        notListLiteral(lhs, "string");
+	        notListLiteral(rhs, "string");
 	        result = new ComparisonExpression(lhs, rhs, t.image);
 	        result.setLocation(template, lhs, rhs);
         }
@@ -1832,10 +1832,10 @@ Expression RelationalExpression() :
         )
         rhs = RangeExpression()
         {
-            notHashLiteral(lhs, "scalar");
-            notHashLiteral(rhs, "scalar");
-            notListLiteral(lhs, "scalar");
-            notListLiteral(rhs, "scalar");
+            notHashLiteral(lhs, "number");
+            notHashLiteral(rhs, "number");
+            notListLiteral(lhs, "number");
+            notListLiteral(rhs, "number");
             notStringLiteral(lhs, "number");
             notStringLiteral(rhs, "number");
             result = new ComparisonExpression(lhs, rhs, t.image);


[2/2] incubator-freemarker git commit: (TemplateScalarModel JavaDoc improvement)

Posted by dd...@apache.org.
(TemplateScalarModel JavaDoc improvement)


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

Branch: refs/heads/2.3-gae
Commit: 05dc3856ce729946b9cf60c17b5e0a1331a4d77c
Parents: 61902c3
Author: ddekany <dd...@apache.org>
Authored: Sun Aug 20 23:57:08 2017 +0200
Committer: ddekany <dd...@apache.org>
Committed: Sun Aug 20 23:57:08 2017 +0200

----------------------------------------------------------------------
 .../java/freemarker/template/TemplateScalarModel.java | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/05dc3856/src/main/java/freemarker/template/TemplateScalarModel.java
----------------------------------------------------------------------
diff --git a/src/main/java/freemarker/template/TemplateScalarModel.java b/src/main/java/freemarker/template/TemplateScalarModel.java
index ca67f75..7b628de 100644
--- a/src/main/java/freemarker/template/TemplateScalarModel.java
+++ b/src/main/java/freemarker/template/TemplateScalarModel.java
@@ -19,10 +19,15 @@
 
 package freemarker.template;
 
+import freemarker.core.TemplateMarkupOutputModel;
+
 /**
  * "string" template language data-type; like in Java, an unmodifiable UNICODE character sequence.
  * (The name of this interface should be {@code TemplateStringModel}. The misnomer is inherited from the
  * old times, when this was the only single-value type in FreeMarker.)
+ * When a template has to print a value of this class, it will assume that it stores plain text (not HTML, XML, etc.),
+ * and thus it will be possibly auto-escaped. To avoid that, use the appropriate {@link TemplateMarkupOutputModel}
+ * instead.
  */
 public interface TemplateScalarModel extends TemplateModel {
 
@@ -32,12 +37,9 @@ public interface TemplateScalarModel extends TemplateModel {
     public TemplateModel EMPTY_STRING = new SimpleScalar("");
 
     /**
-     * Returns the string representation of this model. Don't return {@code null}, as that will cause exception. (In
-     * classic-compatible mode the engine will convert {@code null} into empty string, though.)
-     * 
-     * <p>
-     * Objects of this type should be immutable, that is, calling {@link #getAsString()} should always return the same
-     * value as for the first time.
+     * Returns the {@link String} representation of this model. Returning {@code null} is illegal, and may cause
+     * exception in the calling code. (Except, in classic-compatible mode the engine will convert {@code null} into
+     * empty string.)
      */
     public String getAsString() throws TemplateModelException;