commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hen...@apache.org
Subject svn commit: r810815 - 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
Date Thu, 03 Sep 2009 08:42:07 GMT
Author: henrib
Date: Thu Sep  3 08:42:06 2009
New Revision: 810815

URL: http://svn.apache.org/viewvc?rev=810815&view=rev
Log:
Allow single line comment // to end on EOF; 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=810815&r1=810814&r2=810815&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 08:42:06 2009
@@ -85,7 +85,7 @@
 {
   <COMMENT: ( "##" ( ~["\"","\n","\r"] )* ("\n" | "\r") ) >
 | <"/*" (~["*"])* "*" ("*" | ~["*","/"] (~["*"])* "*")* "/">
-| <"//" (~["\n","\r"])* ("\n" | "\r" | "\r\n")>
+| <"//" (~["\n","\r"])* ("\n" | "\r" | "\r\n")? >
 | " "
 | "\t"
 | "\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=810815&r1=810814&r2=810815&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 08:42:06 2009
@@ -304,4 +304,17 @@
         }
         debuggerCheck(jexl);
     }
+
+    // JEXL-44
+    public void test44() throws Exception {
+        JexlContext ctxt = JexlHelper.createContext();
+        JexlEngine jexl = new JexlEngine();
+        jexl.setSilent(false);
+        jexl.setLenient(false);
+        Script script;
+        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));
+    }
 }



Mime
View raw message