jon 00/11/07 18:52:20
Modified: src/java/org/apache/velocity/runtime/parser Parser.java
Parser.jjt
Log:
fixed my stupid mistakes. need to re-throw the ParserException with
all the previous data in it after attempting to log the stack trace
Revision Changes Path
1.29 +8 -2
jakarta-velocity/src/java/org/apache/velocity/runtime/parser/Parser.java
Index: Parser.java
===================================================================
RCS file:
/home/cvs/jakarta-velocity/src/java/org/apache/velocity/runtime/parser/Parser.java,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -r1.28 -r1.29
--- Parser.java 2000/11/08 02:44:59 1.28
+++ Parser.java 2000/11/08 02:52:17 1.29
@@ -20,7 +20,7 @@
*
* @author <a href="mailto:[EMAIL PROTECTED]">Jason van Zyl</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Geir Magnusson Jr.</a>
- * @version $Id: Parser.java,v 1.28 2000/11/08 02:44:59 jon Exp $
+ * @version $Id: Parser.java,v 1.29 2000/11/08 02:52:17 jon Exp $
*/
public class Parser/*@bgen(jjtree)*/implements ParserTreeConstants, ParserConstants
{/*@bgen(jjtree)*/
protected JJTParserState jjtree = new JJTParserState();/**
@@ -65,7 +65,13 @@
ReInit(stream);
sn = process();
}
- catch (Exception e )
+ catch (ParseException pe)
+ {
+ Runtime.error ("Parser Exception: " + StringUtils.stackTrace(pe));
+ throw new ParseException (pe.currentToken,
+ pe.expectedTokenSequences, pe.tokenImage);
+ }
+ catch (Exception e)
{
Runtime.error ("Parser Error: " + StringUtils.stackTrace(e));
}
1.28 +8 -2
jakarta-velocity/src/java/org/apache/velocity/runtime/parser/Parser.jjt
Index: Parser.jjt
===================================================================
RCS file:
/home/cvs/jakarta-velocity/src/java/org/apache/velocity/runtime/parser/Parser.jjt,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -r1.27 -r1.28
--- Parser.jjt 2000/11/08 02:45:00 1.27
+++ Parser.jjt 2000/11/08 02:52:19 1.28
@@ -129,7 +129,7 @@
*
* @author <a href="mailto:[EMAIL PROTECTED]">Jason van Zyl</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Geir Magnusson Jr.</a>
- * @version $Id: Parser.jjt,v 1.27 2000/11/08 02:45:00 jon Exp $
+ * @version $Id: Parser.jjt,v 1.28 2000/11/08 02:52:19 jon Exp $
*/
public class Parser
{
@@ -175,7 +175,13 @@
ReInit(stream);
sn = process();
}
- catch (Exception e )
+ catch (ParseException pe)
+ {
+ Runtime.error ("Parser Exception: " + StringUtils.stackTrace(pe));
+ throw new ParseException (pe.currentToken,
+ pe.expectedTokenSequences, pe.tokenImage);
+ }
+ catch (Exception e)
{
Runtime.error ("Parser Error: " + StringUtils.stackTrace(e));
}