You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by us...@apache.org on 2015/08/07 09:17:24 UTC

svn commit: r1694615 [4/4] - in /lucene/dev/branches/branch_5x: ./ lucene/ lucene/expressions/ lucene/expressions/src/java/org/apache/lucene/expressions/js/ lucene/expressions/src/test/org/apache/lucene/expressions/js/ lucene/licenses/ solr/ solr/core/...

Copied: lucene/dev/branches/branch_5x/lucene/expressions/src/java/org/apache/lucene/expressions/js/JavascriptVisitor.java (from r1694614, lucene/dev/trunk/lucene/expressions/src/java/org/apache/lucene/expressions/js/JavascriptVisitor.java)
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/lucene/expressions/src/java/org/apache/lucene/expressions/js/JavascriptVisitor.java?p2=lucene/dev/branches/branch_5x/lucene/expressions/src/java/org/apache/lucene/expressions/js/JavascriptVisitor.java&p1=lucene/dev/trunk/lucene/expressions/src/java/org/apache/lucene/expressions/js/JavascriptVisitor.java&r1=1694614&r2=1694615&rev=1694615&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/expressions/src/java/org/apache/lucene/expressions/js/JavascriptVisitor.java (original)
+++ lucene/dev/branches/branch_5x/lucene/expressions/src/java/org/apache/lucene/expressions/js/JavascriptVisitor.java Fri Aug  7 07:17:23 2015
@@ -18,108 +18,108 @@ interface JavascriptVisitor<T> extends P
    */
   T visitCompile(JavascriptParser.CompileContext ctx);
   /**
-   * Visit a parse tree produced by the {@code conditional}
+   * Visit a parse tree produced by the {@code numeric}
    * labeled alternative in {@link JavascriptParser#expression}.
    * @param ctx the parse tree
    * @return the visitor result
    */
-  T visitConditional(JavascriptParser.ConditionalContext ctx);
+  T visitNumeric(JavascriptParser.NumericContext ctx);
   /**
-   * Visit a parse tree produced by the {@code boolor}
+   * Visit a parse tree produced by the {@code precedence}
    * labeled alternative in {@link JavascriptParser#expression}.
    * @param ctx the parse tree
    * @return the visitor result
    */
-  T visitBoolor(JavascriptParser.BoolorContext ctx);
+  T visitPrecedence(JavascriptParser.PrecedenceContext ctx);
   /**
-   * Visit a parse tree produced by the {@code boolcomp}
+   * Visit a parse tree produced by the {@code external}
    * labeled alternative in {@link JavascriptParser#expression}.
    * @param ctx the parse tree
    * @return the visitor result
    */
-  T visitBoolcomp(JavascriptParser.BoolcompContext ctx);
+  T visitExternal(JavascriptParser.ExternalContext ctx);
   /**
-   * Visit a parse tree produced by the {@code numeric}
+   * Visit a parse tree produced by the {@code bwshift}
    * labeled alternative in {@link JavascriptParser#expression}.
    * @param ctx the parse tree
    * @return the visitor result
    */
-  T visitNumeric(JavascriptParser.NumericContext ctx);
+  T visitBwshift(JavascriptParser.BwshiftContext ctx);
   /**
-   * Visit a parse tree produced by the {@code addsub}
+   * Visit a parse tree produced by the {@code boolcomp}
    * labeled alternative in {@link JavascriptParser#expression}.
    * @param ctx the parse tree
    * @return the visitor result
    */
-  T visitAddsub(JavascriptParser.AddsubContext ctx);
+  T visitBoolcomp(JavascriptParser.BoolcompContext ctx);
   /**
-   * Visit a parse tree produced by the {@code unary}
+   * Visit a parse tree produced by the {@code bwxor}
    * labeled alternative in {@link JavascriptParser#expression}.
    * @param ctx the parse tree
    * @return the visitor result
    */
-  T visitUnary(JavascriptParser.UnaryContext ctx);
+  T visitBwxor(JavascriptParser.BwxorContext ctx);
   /**
-   * Visit a parse tree produced by the {@code precedence}
+   * Visit a parse tree produced by the {@code bwor}
    * labeled alternative in {@link JavascriptParser#expression}.
    * @param ctx the parse tree
    * @return the visitor result
    */
-  T visitPrecedence(JavascriptParser.PrecedenceContext ctx);
+  T visitBwor(JavascriptParser.BworContext ctx);
   /**
-   * Visit a parse tree produced by the {@code muldiv}
+   * Visit a parse tree produced by the {@code boolor}
    * labeled alternative in {@link JavascriptParser#expression}.
    * @param ctx the parse tree
    * @return the visitor result
    */
-  T visitMuldiv(JavascriptParser.MuldivContext ctx);
+  T visitBoolor(JavascriptParser.BoolorContext ctx);
   /**
-   * Visit a parse tree produced by the {@code external}
+   * Visit a parse tree produced by the {@code bwand}
    * labeled alternative in {@link JavascriptParser#expression}.
    * @param ctx the parse tree
    * @return the visitor result
    */
-  T visitExternal(JavascriptParser.ExternalContext ctx);
+  T visitBwand(JavascriptParser.BwandContext ctx);
   /**
-   * Visit a parse tree produced by the {@code bwshift}
+   * Visit a parse tree produced by the {@code unary}
    * labeled alternative in {@link JavascriptParser#expression}.
    * @param ctx the parse tree
    * @return the visitor result
    */
-  T visitBwshift(JavascriptParser.BwshiftContext ctx);
+  T visitUnary(JavascriptParser.UnaryContext ctx);
   /**
-   * Visit a parse tree produced by the {@code bwor}
+   * Visit a parse tree produced by the {@code booland}
    * labeled alternative in {@link JavascriptParser#expression}.
    * @param ctx the parse tree
    * @return the visitor result
    */
-  T visitBwor(JavascriptParser.BworContext ctx);
+  T visitBooland(JavascriptParser.BoolandContext ctx);
   /**
-   * Visit a parse tree produced by the {@code booland}
+   * Visit a parse tree produced by the {@code addsub}
    * labeled alternative in {@link JavascriptParser#expression}.
    * @param ctx the parse tree
    * @return the visitor result
    */
-  T visitBooland(JavascriptParser.BoolandContext ctx);
+  T visitAddsub(JavascriptParser.AddsubContext ctx);
   /**
-   * Visit a parse tree produced by the {@code bwxor}
+   * Visit a parse tree produced by the {@code booleqne}
    * labeled alternative in {@link JavascriptParser#expression}.
    * @param ctx the parse tree
    * @return the visitor result
    */
-  T visitBwxor(JavascriptParser.BwxorContext ctx);
+  T visitBooleqne(JavascriptParser.BooleqneContext ctx);
   /**
-   * Visit a parse tree produced by the {@code bwand}
+   * Visit a parse tree produced by the {@code conditional}
    * labeled alternative in {@link JavascriptParser#expression}.
    * @param ctx the parse tree
    * @return the visitor result
    */
-  T visitBwand(JavascriptParser.BwandContext ctx);
+  T visitConditional(JavascriptParser.ConditionalContext ctx);
   /**
-   * Visit a parse tree produced by the {@code booleqne}
+   * Visit a parse tree produced by the {@code muldiv}
    * labeled alternative in {@link JavascriptParser#expression}.
    * @param ctx the parse tree
    * @return the visitor result
    */
-  T visitBooleqne(JavascriptParser.BooleqneContext ctx);
+  T visitMuldiv(JavascriptParser.MuldivContext ctx);
 }

Modified: lucene/dev/branches/branch_5x/lucene/expressions/src/test/org/apache/lucene/expressions/js/TestJavascriptCompiler.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/lucene/expressions/src/test/org/apache/lucene/expressions/js/TestJavascriptCompiler.java?rev=1694615&r1=1694614&r2=1694615&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/lucene/expressions/src/test/org/apache/lucene/expressions/js/TestJavascriptCompiler.java (original)
+++ lucene/dev/branches/branch_5x/lucene/expressions/src/test/org/apache/lucene/expressions/js/TestJavascriptCompiler.java Fri Aug  7 07:17:23 2015
@@ -18,11 +18,12 @@ package org.apache.lucene.expressions.js
 
 import java.text.ParseException;
 
+import org.antlr.v4.runtime.RecognitionException;
 import org.apache.lucene.expressions.Expression;
 import org.apache.lucene.util.LuceneTestCase;
 
 public class TestJavascriptCompiler extends LuceneTestCase {
-  
+
   public void testValidCompiles() throws Exception {
     assertNotNull(JavascriptCompiler.compile("100"));
     assertNotNull(JavascriptCompiler.compile("valid0+100"));
@@ -99,6 +100,15 @@ public class TestJavascriptCompiler exte
     }
   }
 
+  public void testInvalidLexer() throws Exception {
+    try {
+      JavascriptCompiler.compile("\n .");
+      fail();
+    } catch (ParseException pe) {
+      assertTrue(pe.getMessage().contains("unexpected character '.' on line (2) position (1)"));
+    }
+  }
+
   public void testInvalidCompiles() throws Exception {
     try {
       JavascriptCompiler.compile("100 100");

Modified: lucene/dev/branches/branch_5x/lucene/ivy-versions.properties
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/lucene/ivy-versions.properties?rev=1694615&r1=1694614&r2=1694615&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/lucene/ivy-versions.properties (original)
+++ lucene/dev/branches/branch_5x/lucene/ivy-versions.properties Fri Aug  7 07:17:23 2015
@@ -86,7 +86,7 @@ com.sun.jersey.version = 1.9
 /net.sourceforge.argparse4j/argparse4j = 0.4.3
 /net.sourceforge.jmatio/jmatio = 1.0
 /net.sourceforge.nekohtml/nekohtml = 1.9.17
-/org.antlr/antlr-runtime = 3.5
+/org.antlr/antlr4-runtime = 4.5
 /org.apache.ant/ant = 1.8.2
 /org.apache.avro/avro = 1.7.5
 /org.apache.commons/commons-compress = 1.8.1

Modified: lucene/dev/branches/branch_5x/solr/core/ivy.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/core/ivy.xml?rev=1694615&r1=1694614&r2=1694615&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/solr/core/ivy.xml (original)
+++ lucene/dev/branches/branch_5x/solr/core/ivy.xml Fri Aug  7 07:17:23 2015
@@ -37,7 +37,7 @@
     <dependency org="commons-lang" name="commons-lang" rev="${/commons-lang/commons-lang}" conf="compile"/>
     <dependency org="com.google.guava" name="guava" rev="${/com.google.guava/guava}" conf="compile"/>
     <dependency org="com.spatial4j" name="spatial4j" rev="${/com.spatial4j/spatial4j}" conf="compile"/>
-    <dependency org="org.antlr" name="antlr-runtime" rev="${/org.antlr/antlr-runtime}" conf="compile"/>
+    <dependency org="org.antlr" name="antlr4-runtime" rev="${/org.antlr/antlr4-runtime}"/>
     <dependency org="org.apache.commons" name="commons-math3" rev="${/org.apache.commons/commons-math3}" conf="test"/>
     <dependency org="org.ow2.asm" name="asm" rev="${/org.ow2.asm/asm}" conf="compile"/>
     <dependency org="org.ow2.asm" name="asm-commons" rev="${/org.ow2.asm/asm-commons}" conf="compile"/>