commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject svn commit: r1147694 - in /commons/proper/jexl/trunk: pom.xml src/site/xdoc/changes.xml src/site/xdoc/reference/syntax.xml
Date Sun, 17 Jul 2011 18:30:01 GMT
Author: henrib
Date: Sun Jul 17 18:30:00 2011
New Revision: 1147694

JEXL-114 , JEXL-113:
* Edited documentation and changes.xml
* Modified pom.xml for 2.1


Modified: commons/proper/jexl/trunk/pom.xml
--- commons/proper/jexl/trunk/pom.xml (original)
+++ commons/proper/jexl/trunk/pom.xml Sun Jul 17 18:30:00 2011
@@ -24,7 +24,7 @@
-    <version>2.0.2-SNAPSHOT</version>
+    <version>2.1-SNAPSHOT</version>
     <name>Commons JEXL</name>
     <description>Jexl is an implementation of the JSTL Expression Language with extensions.</description>

Modified: commons/proper/jexl/trunk/src/site/xdoc/changes.xml
--- commons/proper/jexl/trunk/src/site/xdoc/changes.xml (original)
+++ commons/proper/jexl/trunk/src/site/xdoc/changes.xml Sun Jul 17 18:30:00 2011
@@ -25,7 +25,13 @@
     <author email="">Commons Developers</author>
-    <release version="2.0.2" date="unreleased">
+    <release version="2.1" date="unreleased">
+        <action dev="henrib" type="add" issue="JEXL-114">
+            Allow scripts to create local variables // Add return keyword
+        </action>
+        <action dev="henrib" type="add" issue="JEXL-113" due-to="Max Tardiveau">
+            Add functions to extract which variables, parameters and local variables are
used to evaluate a script
+        </action>
         <action dev="henrib" type="fix" issue="JEXL-112" due-to="sebb">
             Cannot parse Integer.MIN_VALUE.

Modified: commons/proper/jexl/trunk/src/site/xdoc/reference/syntax.xml
--- commons/proper/jexl/trunk/src/site/xdoc/reference/syntax.xml (original)
+++ commons/proper/jexl/trunk/src/site/xdoc/reference/syntax.xml Sun Jul 17 18:30:00 2011
@@ -78,7 +78,7 @@
               <strong>N.B.</strong> the following keywords are reserved, and
cannot be used as a variable name or property when using the dot operator:
-              <code>or and eq ne lt gt le ge div mod not null true false new</code>
+              <code>or and eq ne lt gt le ge div mod not null true false new var return</code>
               For example, the following is invalid:
               <source> // invalid ('new' is keyword)</source>
               In such cases, the [ ] operator can be used, for example:
@@ -90,6 +90,22 @@
             A script in Jexl is made up of zero or more statements. Scripts can be read from
a String, File or URL.
+            They can be created with named parameters which allow a later evaluation to be
performed with arguments.
+            A script returns the last expression evaluated by default.
+            Using the <code>return</code> keyword, a script will return the expression
that follows (or null).
+          </td>
+        </tr>
+        <tr>
+          <td>Local variables</td>
+          <td>Can be defined using the <code>var</code> keyword; their
identifying rules are the same as contextual variables.
+            <ul>
+              <li>Basic declaration: <code>var x;</code></li>
+              <li>Declaration with assignment: <code>var theAnswer = 42;</code></li>
+              <li>Invalid declaration: <code>var x.y;</code></li>
+            </ul>
+            Their scope is the entire script scope and they take precedence in resolution
over contextual variables.
+            When scripts are created with named parameters, those behave as local variables.
+            Local variables can not use <code>ant-style</code> naming, only one

View raw message