You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@velocity.apache.org by nb...@apache.org on 2008/08/20 01:14:35 UTC

svn commit: r687193 - in /velocity/engine/trunk/src: java/org/apache/velocity/runtime/parser/Parser.jj parser/Parser.jjt

Author: nbubna
Date: Tue Aug 19 16:14:35 2008
New Revision: 687193

URL: http://svn.apache.org/viewvc?rev=687193&view=rev
Log:
continue r687177, put Parser.java changes in javacc sources

Modified:
    velocity/engine/trunk/src/java/org/apache/velocity/runtime/parser/Parser.jj
    velocity/engine/trunk/src/parser/Parser.jjt

Modified: velocity/engine/trunk/src/java/org/apache/velocity/runtime/parser/Parser.jj
URL: http://svn.apache.org/viewvc/velocity/engine/trunk/src/java/org/apache/velocity/runtime/parser/Parser.jj?rev=687193&r1=687192&r2=687193&view=diff
==============================================================================
--- velocity/engine/trunk/src/java/org/apache/velocity/runtime/parser/Parser.jj (original)
+++ velocity/engine/trunk/src/java/org/apache/velocity/runtime/parser/Parser.jj Tue Aug 19 16:14:35 2008
@@ -15,7 +15,7 @@
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
- * under the License.    
+ * under the License.
  */
 
 /*
@@ -23,14 +23,14 @@
  *    to always have to page past it... :)
  */
 options
-{                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
+{
 
     /**
      * The parser must be non-static in order for the
      * above option to work, otherwise the parser value
      * is passed in as null, which isn't all the useful ;)
      */
-    STATIC=false;                                                                                                                                                                                                                                                                                                                       
+    STATIC=false;
 
     /**
      * Declare that we are accepting unicode input and
@@ -55,7 +55,7 @@
 
 import java.io.*;
 import java.util.*;
-
+import org.apache.velocity.exception.VelocityException;
 import org.apache.velocity.runtime.RuntimeServices;
 import org.apache.velocity.runtime.parser.node.*;
 import org.apache.velocity.runtime.directive.Directive;
@@ -181,7 +181,9 @@
         }
         catch (Exception e)
         {
-            rsvc.getLog().error("Parser Error: " + templateName, e);
+            String msg = "Parser Error: " + templateName;
+            rsvc.getLog().error(msg, e);
+            throw new VelocityException(msg, e);
         }
 
         currentTemplateName = "";
@@ -226,7 +228,7 @@
         String strDirective = strImage.substring(iLast + 1);
 
         boolean bRecognizedDirective = false;
-        
+
         // we don't have to call substring method all the time in this method
         String dirTag = strDirective.substring(1);
 
@@ -1687,7 +1689,7 @@
       |
       [ <WHITESPACE> ]
      )
-     
+
      /** note: need both tokens as they are generated in different states **/
      ( <RIGHT_CURLEY> | <RCURLY> )/*@bgen(jjtree)*/
     } catch (Throwable jjte000) {

Modified: velocity/engine/trunk/src/parser/Parser.jjt
URL: http://svn.apache.org/viewvc/velocity/engine/trunk/src/parser/Parser.jjt?rev=687193&r1=687192&r2=687193&view=diff
==============================================================================
--- velocity/engine/trunk/src/parser/Parser.jjt (original)
+++ velocity/engine/trunk/src/parser/Parser.jjt Tue Aug 19 16:14:35 2008
@@ -79,7 +79,7 @@
 
 import java.io.*;
 import java.util.*;
-
+import org.apache.velocity.exception.VelocityException;
 import org.apache.velocity.runtime.RuntimeServices;
 import org.apache.velocity.runtime.parser.node.*;
 import org.apache.velocity.runtime.directive.Directive;
@@ -202,7 +202,9 @@
         }
         catch (Exception e)
         {
-            rsvc.getLog().error("Parser Error: " + templateName, e);
+            String msg = "Parser Error: " + templateName;
+            rsvc.getLog().error(msg, e);
+            throw new VelocityException(msg, e);
         }
 
         currentTemplateName = "";