You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by "spmallette (via GitHub)" <gi...@apache.org> on 2023/06/13 18:50:10 UTC

[GitHub] [tinkerpop] spmallette opened a new pull request, #2094: TINKERPOP-2959 Allowed parsing of parameters with the grammar

spmallette opened a new pull request, #2094:
URL: https://github.com/apache/tinkerpop/pull/2094

   https://issues.apache.org/jira/browse/TINKERPOP-2959
   
   This adds functionality similar to `GremlinGroovyScriptEngine` where bindings can be applied to a script as in `g.V(x)` where `x` is a variable that can be bound to a value external to the script. This functionality doesn't offer any particular performance enhancement for the grammar the way that it does for groovy but it does better allow one engine to be swapped for the other which is crucial for a migration away from the groovy engine. This change also opens up better opportunities for translator and gherkin improvements as well.
   
   Purposefully did not add upgrade docs as I still don't think this functionality is completely ready for general usage.
   
   This is a fairly large diff because it essentially rewrites the core of the antlr grammar and that force a rewrite of much of the parser. It might be best to focus on what's being tested and to try to determine if anything further should be tested in relation to this functionality. 
   
   Performance testing showed that somehow, these changes actually made the parser a tiny bit faster. I basically ran all the Gremlin (minus a few troublemakers) in the documentation (about 600 queries) through the parser 10000 times. My runs with these changes tended to finish in about 65~ seconds typically. Runs on `master` prior to these changes typically ran around 72~ seconds. Here's the script which I just pasted into Gremlin Console (if you want to run be sure to replace `TINKERPOP_HOME_PATH` with the path to your TinkerPop git repo home:
   
   ```groovy
   import org.apache.tinkerpop.gremlin.language.corpus.*
   g = TinkerGraph.open().traversal()
   b = new javax.script.SimpleBindings()
   b.put('g', g)
   lang = new GremlinLangScriptEngine()
   home = 'TINKERPOP_HOME_PATH'
   gremlins = DocumentationReader.parse(home + '/docs/src'); []
   gremlins = gremlins.findAll{ !it.contains("g.union") && !it.contains("coalesce(E") && !it.contains("eq(constant('josh'))") && !it.contains("xx") && !it.contains("branch") && !it.contains("program") && !it.contains("profile") && !it.contains("explain") && !it.contains("connectedComponent") && !it.contains("fill") && !it.contains("next") && !it.contains("toList") && !it.contains("iterate") && !it.contains("withComputer") && !it.contains("{") && !it.contains("withoutStrategies") };[]
   start = System.currentTimeMillis()
   gremlins.each { lang.eval(it, b);[] }
   (0..10000).each {
       if (it % 10 == 9) 
           println "."
       else 
           print "."
       gremlins.each { lang.eval(it, b);[] }
   }
   end = System.currentTimeMillis() - start
   ```
   
   VOTE +1


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tinkerpop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [tinkerpop] codecov-commenter commented on pull request #2094: TINKERPOP-2959 Allowed parsing of parameters with the grammar

Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #2094:
URL: https://github.com/apache/tinkerpop/pull/2094#issuecomment-1589864179

   ## [Codecov](https://app.codecov.io/gh/apache/tinkerpop/pull/2094?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   > Merging [#2094](https://app.codecov.io/gh/apache/tinkerpop/pull/2094?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) (f08fac1) into [master](https://app.codecov.io/gh/apache/tinkerpop/commit/6d55564560bb2210f78e8e0a0bea0e9ce41bd6a1?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) (6d55564) will **decrease** coverage by `4.73%`.
   > The diff coverage is `n/a`.
   
   ```diff
   @@             Coverage Diff              @@
   ##             master    #2094      +/-   ##
   ============================================
   - Coverage     74.82%   70.10%   -4.73%     
   ============================================
     Files          1025       24    -1001     
     Lines         62019     3532   -58487     
     Branches       6844        0    -6844     
   ============================================
   - Hits          46404     2476   -43928     
   + Misses        13068      884   -12184     
   + Partials       2547      172    -2375     
   ```
   
   
   [see 998 files with indirect coverage changes](https://app.codecov.io/gh/apache/tinkerpop/pull/2094/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
   
   :mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tinkerpop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [tinkerpop] Cole-Greer commented on pull request #2094: TINKERPOP-2959 Allowed parsing of parameters with the grammar

Posted by "Cole-Greer (via GitHub)" <gi...@apache.org>.
Cole-Greer commented on PR #2094:
URL: https://github.com/apache/tinkerpop/pull/2094#issuecomment-1593795756

   Thanks for putting this all together Stephen. I'm a big fan of anything which reduces the gap between gremlin-lang and gremlin-groovy. This is a bit out of my wheelhouse but I took a good look through the new grammar and tests. Other than the one question I posted above about mapEntry, it all looks good to me.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tinkerpop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [tinkerpop] Cole-Greer commented on a diff in pull request #2094: TINKERPOP-2959 Allowed parsing of parameters with the grammar

Posted by "Cole-Greer (via GitHub)" <gi...@apache.org>.
Cole-Greer commented on code in PR #2094:
URL: https://github.com/apache/tinkerpop/pull/2094#discussion_r1231588579


##########
gremlin-language/src/main/antlr4/Gremlin.g4:
##########
@@ -1403,7 +1521,7 @@ genericLiteralMap
     | LBRACK mapEntry (COMMA mapEntry)* RBRACK
     ;
 
-// allow builds of Map that sorta make sense in the Gremlin context
+// allow builds of Map that sorta make sense in the Gremlin context.
 mapEntry
     : NEW COLON genericLiteral  // explicit for [new: true] - if we had other keywords like that maybe we'd group them up?
     | (LPAREN stringLiteral RPAREN | stringLiteral) COLON genericLiteral

Review Comment:
   I believe that for each of these, the value part of the mapEntry should be a `genericLiteralArgument` instead of just a `genericLiteral`. Just checked in console and groovy allows passing variables as the value in maps.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tinkerpop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [tinkerpop] Cole-Greer commented on pull request #2094: TINKERPOP-2959 Allowed parsing of parameters with the grammar

Posted by "Cole-Greer (via GitHub)" <gi...@apache.org>.
Cole-Greer commented on PR #2094:
URL: https://github.com/apache/tinkerpop/pull/2094#issuecomment-1594952371

   LGTM VOTE +1


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tinkerpop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [tinkerpop] xiazcy commented on pull request #2094: TINKERPOP-2959 Allowed parsing of parameters with the grammar

Posted by "xiazcy (via GitHub)" <gi...@apache.org>.
xiazcy commented on PR #2094:
URL: https://github.com/apache/tinkerpop/pull/2094#issuecomment-1593701729

   This feature definitely opens up improvement opportunties. I'm not too familiar with many of the technical details, but on a high level the change looks good. I also like how the grammar variables are more intuitive now. VOTE +1


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tinkerpop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [tinkerpop] spmallette commented on pull request #2094: TINKERPOP-2959 Allowed parsing of parameters with the grammar

Posted by "spmallette (via GitHub)" <gi...@apache.org>.
spmallette commented on PR #2094:
URL: https://github.com/apache/tinkerpop/pull/2094#issuecomment-1594707500

   @vkagamlyk addressed your comments and pushed a new version


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tinkerpop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [tinkerpop] vkagamlyk commented on a diff in pull request #2094: TINKERPOP-2959 Allowed parsing of parameters with the grammar

Posted by "vkagamlyk (via GitHub)" <gi...@apache.org>.
vkagamlyk commented on code in PR #2094:
URL: https://github.com/apache/tinkerpop/pull/2094#discussion_r1231504873


##########
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/grammar/ArgumentVisitor.java:
##########
@@ -0,0 +1,420 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "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.
+ */
+package org.apache.tinkerpop.gremlin.language.grammar;
+
+import org.apache.tinkerpop.gremlin.process.traversal.Merge;
+import org.apache.tinkerpop.gremlin.process.traversal.Operator;
+import org.apache.tinkerpop.gremlin.process.traversal.Order;
+import org.apache.tinkerpop.gremlin.process.traversal.Pop;
+import org.apache.tinkerpop.gremlin.process.traversal.SackFunctions;
+import org.apache.tinkerpop.gremlin.process.traversal.Scope;
+import org.apache.tinkerpop.gremlin.structure.Column;
+import org.apache.tinkerpop.gremlin.structure.Direction;
+import org.apache.tinkerpop.gremlin.structure.T;
+import org.apache.tinkerpop.gremlin.structure.Vertex;
+import org.apache.tinkerpop.gremlin.structure.VertexProperty;
+
+import java.lang.reflect.Array;
+import java.util.Collection;
+import java.util.Comparator;
+import java.util.Map;
+import java.util.function.Function;
+
+public class ArgumentVisitor extends DefaultGremlinBaseVisitor<Object> {
+
+    private final VariableResolver resolver;
+
+    private final GremlinAntlrToJava antlr;
+
+    public ArgumentVisitor(final VariableResolver resolver, final GremlinAntlrToJava antlr) {
+        this.resolver = resolver;
+        this.antlr = antlr;
+    }
+
+    /**
+     * Wrapper to visit function for boolean.
+     */
+    public boolean parseBoolean(final GremlinParser.BooleanArgumentContext ctx) {
+        return (boolean) visitBooleanArgument(ctx);
+    }
+
+    /**
+     * Wrapper to visit function for integer types.
+     */
+    public Number parseNumber(final GremlinParser.IntegerArgumentContext ctx) {
+        return (Number) visitIntegerArgument(ctx);
+    }
+
+    /**
+     * Wrapper to visit function for float types.
+     */
+    public Number parseNumber(final GremlinParser.FloatArgumentContext ctx) {
+        return (Number) visitFloatArgument(ctx);
+    }
+
+    /**
+     * Wrapper to visit function for string types.
+     */
+    public String parseString(final GremlinParser.StringArgumentContext ctx) {
+        return (String) visitStringArgument(ctx);
+    }
+
+    /**
+     * Wrapper for visit function for object types.
+     */
+    public Object parseObject(final GremlinParser.GenericLiteralArgumentContext ctx) {
+        return visitGenericLiteralArgument(ctx);
+    }
+
+    /**
+     * Wrapper for visit function for {@link Direction} types.
+     */
+    public Direction parseDirection(final GremlinParser.TraversalDirectionArgumentContext ctx) {
+        return (Direction) visitTraversalDirectionArgument(ctx);
+    }
+
+    /**
+     * Wrapper for visit function for {@link Vertex} types.
+     */
+    public Vertex parseVertex(final GremlinParser.StructureVertexArgumentContext ctx) {
+        return (Vertex) visitStructureVertexArgument(ctx);
+    }
+
+    /**
+     * Wrapper for visit function for {@link Order} types.
+     */
+    public Order parseOrder(final GremlinParser.TraversalOrderArgumentContext ctx) {
+        return (Order) visitTraversalOrderArgument(ctx);
+    }
+
+    /**
+     * Wrapper for visit function for {@link Scope} types.
+     */
+    public Scope parseScope(final GremlinParser.TraversalScopeArgumentContext ctx) {
+        return (Scope) visitTraversalScopeArgument(ctx);
+    }
+
+    /**
+     * Wrapper for visit function for {@link T} types.
+     */
+    public T parseT(final GremlinParser.TraversalTokenArgumentContext ctx) {
+        return (T) visitTraversalTokenArgument(ctx);
+    }
+
+    /**
+     * Wrapper for visit function for {@link VertexProperty.Cardinality} types.
+     */
+    public VertexProperty.Cardinality parseCardinality(final GremlinParser.TraversalCardinalityArgumentContext ctx) {
+        return (VertexProperty.Cardinality) visitTraversalCardinalityArgument(ctx);
+    }
+
+    /**
+     * Wrapper for visit function for {@link Merge} types.
+     */
+    public Merge parseMerge(final GremlinParser.TraversalMergeArgumentContext ctx) {
+        return (Merge) visitTraversalMergeArgument(ctx);
+    }
+
+    /**
+     * Wrapper for visit function for {@link Pop} types.
+     */
+    public Pop parsePop(final GremlinParser.TraversalPopArgumentContext ctx) {
+        return (Pop) visitTraversalPopArgument(ctx);
+    }
+
+    /**
+     * Wrapper for visit function for {@link Pop} types.
+     */
+    public Column parseColumn(final GremlinParser.TraversalColumnArgumentContext ctx) {
+        return (Column) visitTraversalColumnArgument(ctx);
+    }
+
+    /**
+     * Wrapper for visit function for {@code Function} types like {@link T} and {@link Column}.
+     */
+    public Function parseFunction(final GremlinParser.TraversalFunctionArgumentContext ctx) {
+        return (Function) visitTraversalFunctionArgument(ctx);
+    }
+
+    /**
+     * Wrapper for visit function for {@code Comparator} types like {@link Order}.
+     */
+    public Comparator parseComparator(final GremlinParser.TraversalComparatorArgumentContext ctx) {
+        return (Comparator) visitTraversalComparatorArgument(ctx);
+    }
+
+    /**
+     * Wrapper for visit function for {@code Map} types.
+     */
+    public Map parseMap(final GremlinParser.GenericLiteralMapArgumentContext ctx) {
+        return (Map) visitGenericLiteralMapArgument(ctx);
+    }
+
+    /**
+     * Wrapper for visit function for {@code Map} types.
+     */
+    public Map parseMap(final GremlinParser.GenericLiteralMapNullableArgumentContext ctx) {
+        return (Map) visitGenericLiteralMapNullableArgument(ctx);
+    }
+
+    /**
+     * Wrapper for visit function for list types.
+     */
+    public Object[] parseObjectVarargs(final GremlinParser.GenericLiteralListArgumentContext ctx) {
+        if (ctx.genericLiteralList() != null) {
+            return antlr.genericVisitor.parseObjectList(ctx.genericLiteralList());
+        } else {
+            final Object l = visitVariable(ctx.variable());
+            if (null == l) {
+                return null;
+            } else if (l.getClass().isArray()) {
+                int length = Array.getLength(l);
+                Object[] result = new Object[length];
+                for (int i = 0; i < length; i++) {
+                    result[i] = Array.get(l, i);
+                }
+                return result;
+            } else if (l instanceof Collection) {
+                Collection<?> collection = (Collection<?>) l;
+                return collection.toArray();
+            } else {

Review Comment:
   is it possible to get Vararg as `Iterable`?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tinkerpop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [tinkerpop] vkagamlyk commented on pull request #2094: TINKERPOP-2959 Allowed parsing of parameters with the grammar

Posted by "vkagamlyk (via GitHub)" <gi...@apache.org>.
vkagamlyk commented on PR #2094:
URL: https://github.com/apache/tinkerpop/pull/2094#issuecomment-1594866325

   > @vkagamlyk addressed your comments and pushed a new version
   
   Thank you!
   
   VOTE +1


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tinkerpop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [tinkerpop] spmallette commented on a diff in pull request #2094: TINKERPOP-2959 Allowed parsing of parameters with the grammar

Posted by "spmallette (via GitHub)" <gi...@apache.org>.
spmallette commented on code in PR #2094:
URL: https://github.com/apache/tinkerpop/pull/2094#discussion_r1232213927


##########
gremlin-language/src/main/antlr4/Gremlin.g4:
##########
@@ -1403,7 +1521,7 @@ genericLiteralMap
     | LBRACK mapEntry (COMMA mapEntry)* RBRACK
     ;
 
-// allow builds of Map that sorta make sense in the Gremlin context
+// allow builds of Map that sorta make sense in the Gremlin context.
 mapEntry
     : NEW COLON genericLiteral  // explicit for [new: true] - if we had other keywords like that maybe we'd group them up?
     | (LPAREN stringLiteral RPAREN | stringLiteral) COLON genericLiteral

Review Comment:
   ehhh - i purposefully didn't allow that. if you want a variable in a `Map` for the grammar then you gotta do the whole `Map`. if we hate that in the future we can always open that up i guess.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tinkerpop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [tinkerpop] vkagamlyk commented on a diff in pull request #2094: TINKERPOP-2959 Allowed parsing of parameters with the grammar

Posted by "vkagamlyk (via GitHub)" <gi...@apache.org>.
vkagamlyk commented on code in PR #2094:
URL: https://github.com/apache/tinkerpop/pull/2094#discussion_r1231535172


##########
gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/language/grammar/ArgumentVisitorTest.java:
##########
@@ -0,0 +1,260 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "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.
+ */
+package org.apache.tinkerpop.gremlin.language.grammar;
+
+import org.antlr.v4.runtime.CharStreams;
+import org.antlr.v4.runtime.CommonTokenStream;
+import org.apache.tinkerpop.gremlin.process.traversal.IO;
+import org.apache.tinkerpop.gremlin.process.traversal.Merge;
+import org.apache.tinkerpop.gremlin.process.traversal.Operator;
+import org.apache.tinkerpop.gremlin.process.traversal.Order;
+import org.apache.tinkerpop.gremlin.process.traversal.P;
+import org.apache.tinkerpop.gremlin.process.traversal.Pop;
+import org.apache.tinkerpop.gremlin.process.traversal.SackFunctions;
+import org.apache.tinkerpop.gremlin.process.traversal.Scope;
+import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource;
+import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__;
+import org.apache.tinkerpop.gremlin.structure.Column;
+import org.apache.tinkerpop.gremlin.structure.Direction;
+import org.apache.tinkerpop.gremlin.structure.T;
+import org.apache.tinkerpop.gremlin.structure.Vertex;
+import org.apache.tinkerpop.gremlin.structure.VertexProperty;
+import org.apache.tinkerpop.gremlin.structure.util.ElementHelper;
+import org.apache.tinkerpop.gremlin.structure.util.empty.EmptyGraph;
+import org.apache.tinkerpop.gremlin.structure.util.reference.ReferenceVertex;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+
+import java.util.Arrays;
+import java.util.Date;
+import java.util.List;
+import java.util.function.Supplier;
+
+import static org.apache.tinkerpop.gremlin.process.traversal.AnonymousTraversalSource.traversal;
+import static org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__.has;
+import static org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__.hasLabel;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.core.IsInstanceOf.instanceOf;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
+
+@RunWith(Parameterized.class)
+public class ArgumentVisitorTest {
+    @Parameterized.Parameter(value = 0)
+    public Class<?> clazz;
+
+    @Parameterized.Parameter(value = 1)
+    public String script;
+
+    @Parameterized.Parameter(value = 2)
+    public Object expected;
+
+    @Parameterized.Parameter(value = 3)
+    public GremlinAntlrToJava antlrToLanguage;
+
+    private static final GraphTraversalSource g = EmptyGraph.instance().traversal();
+
+    private static final Date now = new Date();
+
+    @Parameterized.Parameters(name = "{0}")
+    public static Iterable<Object[]> generateTestParameters() {
+        return Arrays.asList(new Object[][]{
+                {Boolean.class, "x", new VariableResolverException("x"), createAntlr(VariableResolver.NoVariableResolver.instance())},
+                {Boolean.class, "true", true, createAntlr(new VariableResolver.DefaultVariableResolver(ElementHelper.asMap("x", true)))},
+                {Boolean.class, "false", false, createAntlr(new VariableResolver.DefaultVariableResolver(ElementHelper.asMap("x", true)))},
+                {Boolean.class, "x", true, createAntlr(new VariableResolver.DefaultVariableResolver(ElementHelper.asMap("x", true)))},
+                {Integer.class, "x", new VariableResolverException("x"), createAntlr(VariableResolver.NoVariableResolver.instance())},
+                {Integer.class, "0", 0, createAntlr(new VariableResolver.DefaultVariableResolver(ElementHelper.asMap("x", 100)))},
+                {Integer.class, "0i", 0, createAntlr(new VariableResolver.DefaultVariableResolver(ElementHelper.asMap("x", 100)))},
+                {Integer.class, "0L", 0L, createAntlr(new VariableResolver.DefaultVariableResolver(ElementHelper.asMap("x", 100)))},
+                {Integer.class, "x", 0, createAntlr(new VariableResolver.DefaultVariableResolver(ElementHelper.asMap("x", 0)))},
+                {Integer.class, "x", 0L, createAntlr(new VariableResolver.DefaultVariableResolver(ElementHelper.asMap("x", 0L)))},
+                {Float.class, "x", new VariableResolverException("x"), createAntlr(VariableResolver.NoVariableResolver.instance())},
+                {Float.class, "0.0d", 0.0, createAntlr(new VariableResolver.DefaultVariableResolver(ElementHelper.asMap("x", 1000.0)))},
+                {Float.class, "0d", 0.0, createAntlr(new VariableResolver.DefaultVariableResolver(ElementHelper.asMap("x", 1000.0)))},
+                {Float.class, "0F", 0.0F, createAntlr(new VariableResolver.DefaultVariableResolver(ElementHelper.asMap("x", 1000.0F)))},
+                {Float.class, "x", 0.0, createAntlr(new VariableResolver.DefaultVariableResolver(ElementHelper.asMap("x", 0.0)))},
+                {Float.class, "x", 0.0F, createAntlr(new VariableResolver.DefaultVariableResolver(ElementHelper.asMap("x", 0.0F)))},
+                {String.class, "x", new VariableResolverException("x"), createAntlr(VariableResolver.NoVariableResolver.instance())},
+                {String.class, "'test'", "test", createAntlr(new VariableResolver.DefaultVariableResolver(ElementHelper.asMap("x", "nope")))},

Review Comment:
   is it possible to pass `null` as string variable value?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tinkerpop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [tinkerpop] spmallette merged pull request #2094: TINKERPOP-2959 Allowed parsing of parameters with the grammar

Posted by "spmallette (via GitHub)" <gi...@apache.org>.
spmallette merged PR #2094:
URL: https://github.com/apache/tinkerpop/pull/2094


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tinkerpop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org