You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@velocity.apache.org by cb...@apache.org on 2018/10/08 19:31:17 UTC

svn commit: r1843190 - in /velocity/site/cms/trunk/content/engine/devel: configuration.mdtext upgrading.mdtext vtl-reference.mdtext

Author: cbrisson
Date: Mon Oct  8 19:31:17 2018
New Revision: 1843190

URL: http://svn.apache.org/viewvc?rev=1843190&view=rev
Log:
[site/engine] Document the new parser.allows.dash.in.identifiers boolean property

Modified:
    velocity/site/cms/trunk/content/engine/devel/configuration.mdtext
    velocity/site/cms/trunk/content/engine/devel/upgrading.mdtext
    velocity/site/cms/trunk/content/engine/devel/vtl-reference.mdtext

Modified: velocity/site/cms/trunk/content/engine/devel/configuration.mdtext
URL: http://svn.apache.org/viewvc/velocity/site/cms/trunk/content/engine/devel/configuration.mdtext?rev=1843190&r1=1843189&r2=1843190&view=diff
==============================================================================
--- velocity/site/cms/trunk/content/engine/devel/configuration.mdtext (original)
+++ velocity/site/cms/trunk/content/engine/devel/configuration.mdtext Mon Oct  8 19:31:17 2018
@@ -236,6 +236,10 @@ The following resource management config
 
 > This property is used by the default pooling implementation to set the number of parser instances that Velocity will create at startup and keep in a pool.  The default of 20 parsers should be more than enough for most uses.  In the event that Velocity does run out of parsers, it will indicate so in the log, and dynamically create overflow instances as needed.  Note that these extra parsers will not be added to the pool, and will be discarded after use.  This will result in very slow operation compared to the normal usage of pooled parsers, but this is considered an exceptional condition.  A web application using Velocity as its view engine might exhibit this behavior under extremely high concurrency (such as when getting Slashdotted).  If you see a corresponding message referencing the `parser.pool.size` property in your log files, please increment this property immediately to avoid performance degradation.
 
+**`parser.allows.dash.in.identifiers = false`**
+
+> This is a backward compatibility option, false by default, which allows the **`-`** character inside variable identifiers. If enabled, be warned that you will have to surround the mathematical minus sign with spaces for it to be correctly interpreted.
+
 ## Event Handlers
 
 See the [Event Handlers](developer-guide.html#event-handlers) section of the dev guide.

Modified: velocity/site/cms/trunk/content/engine/devel/upgrading.mdtext
URL: http://svn.apache.org/viewvc/velocity/site/cms/trunk/content/engine/devel/upgrading.mdtext?rev=1843190&r1=1843189&r2=1843190&view=diff
==============================================================================
--- velocity/site/cms/trunk/content/engine/devel/upgrading.mdtext (original)
+++ velocity/site/cms/trunk/content/engine/devel/upgrading.mdtext Mon Oct  8 19:31:17 2018
@@ -4,13 +4,13 @@ Title: Apache Velocity Engine - Upgradin
 
 Release with the same major number (1.x, 2.x) are intended to be drop-in replacements. However, in most cases the versions of dependency jars must be adjusted because newer versions of Velocity might require updates.
 
-## Upgrading from Velocity 1.7.x to Velocity 2.0.x
+## Upgrading from Velocity 1.7.x to Velocity 2.x
 
 <div class="note">
 Please note that the maven repository path has changed:
 <ul>
   <li>former path: <code>org/apache/velocity/velocity/1.7.<i>x</i></code></li>
-  <li>new path: <code>org/apache/velocity/velocity-engine-core/2.0[.<i>x</i>]</code></li>
+  <li>new path: <code>org/apache/velocity/velocity-engine-core/2.<i>x</i></code></li>
 </ul>
 </div>
 
@@ -19,6 +19,7 @@ For busy people: To maximize backward co
     runtime.conversion.handler = none
     space.gobbling = bc
     directive.if.emptycheck = false
+    parser.allows.dash.identifiers = true
 
 and check the [Dependency changes](#dependencies-changes) below.
 
@@ -43,7 +44,7 @@ Read below for futher details.
 
 ### VTL Changes:
 
-+ the hypen ( `-` ) cannot be used in variable names anymore
++ the hypen ( `-` ) cannot be used in variable names anymore, but this behavior can be restored for backward compatibility by setting the new `parser.allows.dash.in.identifiers` boolean property to true
 + method arguments can be arithmetic expressions
 + method arguments are now converted as needed between all main basic Java standard types (booleans, numbers and strings). If you want to revert to the 1.x behavior, set the property `runtime.conversion.handler = none`.
 + space gobbling (to control the indentation of generated code) is now configurable via the `space.gobbing` configuration key, which can take the following values: `none`, `bc` (aka. backward compatible), `lines` and `structured`. See the related documentation section for details. To maximize backward compatibility with 1.x, set it to `bc`.

Modified: velocity/site/cms/trunk/content/engine/devel/vtl-reference.mdtext
URL: http://svn.apache.org/viewvc/velocity/site/cms/trunk/content/engine/devel/vtl-reference.mdtext?rev=1843190&r1=1843189&r2=1843190&view=diff
==============================================================================
--- velocity/site/cms/trunk/content/engine/devel/vtl-reference.mdtext (original)
+++ velocity/site/cms/trunk/content/engine/devel/vtl-reference.mdtext Mon Oct  8 19:31:17 2018
@@ -19,6 +19,8 @@ Examples:
 + Formal notation: `${mudSlinger_9}`
 + Silent Formal notation: `$!{mudSlinger_9}`
 
+*Note that for backward compatibility reasons, it's possible to enable **`-`** as a valid character in variables identifiers, [see the parser configuration section](configuration.html#parser-configuration)
+
 ### Properties
 
 Notation: