You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by he...@apache.org on 2009/09/03 17:30:53 UTC
svn commit: r810994 - in /commons/proper/jexl/branches/2.0/src:
main/java/org/apache/commons/jexl/parser/Parser.jjt
test/java/org/apache/commons/jexl/IssuesTest.java
Author: henrib
Date: Thu Sep 3 15:30:53 2009
New Revision: 810994
URL: http://svn.apache.org/viewvc?rev=810994&view=rev
Log:
Allow single line comment ## to behave like //; add test
Modified:
commons/proper/jexl/branches/2.0/src/main/java/org/apache/commons/jexl/parser/Parser.jjt
commons/proper/jexl/branches/2.0/src/test/java/org/apache/commons/jexl/IssuesTest.java
Modified: commons/proper/jexl/branches/2.0/src/main/java/org/apache/commons/jexl/parser/Parser.jjt
URL: http://svn.apache.org/viewvc/commons/proper/jexl/branches/2.0/src/main/java/org/apache/commons/jexl/parser/Parser.jjt?rev=810994&r1=810993&r2=810994&view=diff
==============================================================================
--- commons/proper/jexl/branches/2.0/src/main/java/org/apache/commons/jexl/parser/Parser.jjt (original)
+++ commons/proper/jexl/branches/2.0/src/main/java/org/apache/commons/jexl/parser/Parser.jjt Thu Sep 3 15:30:53 2009
@@ -83,7 +83,7 @@
SKIP : /* WHITE SPACE */
{
- <COMMENT: ( "##" ( ~["\"","\n","\r"] )* ("\n" | "\r") ) >
+ <"##" (~["\n","\r"])* ("\n" | "\r" | "\r\n")? >
| <"/*" (~["*"])* "*" ("*" | ~["*","/"] (~["*"])* "*")* "/">
| <"//" (~["\n","\r"])* ("\n" | "\r" | "\r\n")? >
| " "
Modified: commons/proper/jexl/branches/2.0/src/test/java/org/apache/commons/jexl/IssuesTest.java
URL: http://svn.apache.org/viewvc/commons/proper/jexl/branches/2.0/src/test/java/org/apache/commons/jexl/IssuesTest.java?rev=810994&r1=810993&r2=810994&view=diff
==============================================================================
--- commons/proper/jexl/branches/2.0/src/test/java/org/apache/commons/jexl/IssuesTest.java (original)
+++ commons/proper/jexl/branches/2.0/src/test/java/org/apache/commons/jexl/IssuesTest.java Thu Sep 3 15:30:53 2009
@@ -312,5 +312,9 @@
assertEquals("hello world!", script.execute(ctxt));
script = jexl.createScript("'hello world!';//commented\n'bye...'");
assertEquals("bye...", script.execute(ctxt));
+ script = jexl.createScript("'hello world!'## commented");
+ assertEquals("hello world!", script.execute(ctxt));
+ script = jexl.createScript("'hello world!';## commented\n'bye...'");
+ assertEquals("bye...", script.execute(ctxt));
}
}