[jira] [Commented] (TINKERPOP-2959) Allow the grammar to support parameters

2023-06-13 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/TINKERPOP-2959?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17732216#comment-17732216
 ] 

ASF GitHub Bot commented on TINKERPOP-2959:
---

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 
1 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..1).each {
   if (it % 10 == 9) 
   println "."
   else 
   print "."
   gremlins.each { lang.eval(it, b);[] }
   }
   end = System.currentTimeMillis() - start
   ```
   
   VOTE +1




> Allow the grammar to support parameters
> ---
>
> Key: TINKERPOP-2959
> URL: https://issues.apache.org/jira/browse/TINKERPOP-2959
> Project: TinkerPop
>  Issue Type: Improvement
>  Components: language
>Affects Versions: 3.6.4
>Reporter: Stephen Mallette
>Priority: Major
>
> Allow the grammar to support parameters similar to how the groovy engine does 
> like, {{g.inject(x,y,z)}}. Doing this will make it easier for a transition 
> away from the groovy engine as a lot of Gremlin in the world today uses 
> parameters. The grammar may have to come with some limitations though as 
> groovy is wide open in terms of what can be treated as a variable. Probably 
> going to keep parameters tied to primitives, collections and tokens/enums 
> like {{Order}} and {{Scope}}. Collections themselves will not contain 
> parameters and things like a {{Traversal}} or {{P}} cannot be treated as one.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (TINKERPOP-2959) Allow the grammar to support parameters

2023-06-13 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/TINKERPOP-2959?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17732220#comment-17732220
 ] 

ASF GitHub Bot commented on TINKERPOP-2959:
---

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   68440-6844 
   
   - Hits  46404 2476   -43928 
   + Misses13068  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)
   




> Allow the grammar to support parameters
> ---
>
> Key: TINKERPOP-2959
> URL: https://issues.apache.org/jira/browse/TINKERPOP-2959
> Project: TinkerPop
>  Issue Type: Improvement
>  Components: language
>Affects Versions: 3.6.4
>Reporter: Stephen Mallette
>Priority: Major
>
> Allow the grammar to support parameters similar to how the groovy engine does 
> like, {{g.inject(x,y,z)}}. Doing this will make it easier for a transition 
> away from the groovy engine as a lot of Gremlin in the world today uses 
> parameters. The grammar may have to come with some limitations though as 
> groovy is wide open in terms of what can be treated as a variable. Probably 
> going to keep parameters tied to primitives, collections and tokens/enums 
> like {{Order}} and {{Scope}}. Collections themselves will not contain 
> parameters and things like a {{Traversal}} or {{P}} cannot be treated as one.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (TINKERPOP-2959) Allow the grammar to support parameters

2023-06-15 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/TINKERPOP-2959?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17733218#comment-17733218
 ] 

ASF GitHub Bot commented on TINKERPOP-2959:
---

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 {
+
+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 

[jira] [Commented] (TINKERPOP-2959) Allow the grammar to support parameters

2023-06-15 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/TINKERPOP-2959?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17733233#comment-17733233
 ] 

ASF GitHub Bot commented on TINKERPOP-2959:
---

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




> Allow the grammar to support parameters
> ---
>
> Key: TINKERPOP-2959
> URL: https://issues.apache.org/jira/browse/TINKERPOP-2959
> Project: TinkerPop
>  Issue Type: Improvement
>  Components: language
>Affects Versions: 3.6.4
>Reporter: Stephen Mallette
>Priority: Major
>
> Allow the grammar to support parameters similar to how the groovy engine does 
> like, {{g.inject(x,y,z)}}. Doing this will make it easier for a transition 
> away from the groovy engine as a lot of Gremlin in the world today uses 
> parameters. The grammar may have to come with some limitations though as 
> groovy is wide open in terms of what can be treated as a variable. Probably 
> going to keep parameters tied to primitives, collections and tokens/enums 
> like {{Order}} and {{Scope}}. Collections themselves will not contain 
> parameters and things like a {{Traversal}} or {{P}} cannot be treated as one.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (TINKERPOP-2959) Allow the grammar to support parameters

2023-06-15 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/TINKERPOP-2959?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17733238#comment-17733238
 ] 

ASF GitHub Bot commented on TINKERPOP-2959:
---

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 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 

[jira] [Commented] (TINKERPOP-2959) Allow the grammar to support parameters

2023-06-15 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/TINKERPOP-2959?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17733251#comment-17733251
 ] 

ASF GitHub Bot commented on TINKERPOP-2959:
---

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.





> Allow the grammar to support parameters
> ---
>
> Key: TINKERPOP-2959
> URL: https://issues.apache.org/jira/browse/TINKERPOP-2959
> Project: TinkerPop
>  Issue Type: Improvement
>  Components: language
>Affects Versions: 3.6.4
>Reporter: Stephen Mallette
>Priority: Major
>
> Allow the grammar to support parameters similar to how the groovy engine does 
> like, {{g.inject(x,y,z)}}. Doing this will make it easier for a transition 
> away from the groovy engine as a lot of Gremlin in the world today uses 
> parameters. The grammar may have to come with some limitations though as 
> groovy is wide open in terms of what can be treated as a variable. Probably 
> going to keep parameters tied to primitives, collections and tokens/enums 
> like {{Order}} and {{Scope}}. Collections themselves will not contain 
> parameters and things like a {{Traversal}} or {{P}} cannot be treated as one.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (TINKERPOP-2959) Allow the grammar to support parameters

2023-06-15 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/TINKERPOP-2959?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17733253#comment-17733253
 ] 

ASF GitHub Bot commented on TINKERPOP-2959:
---

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.




> Allow the grammar to support parameters
> ---
>
> Key: TINKERPOP-2959
> URL: https://issues.apache.org/jira/browse/TINKERPOP-2959
> Project: TinkerPop
>  Issue Type: Improvement
>  Components: language
>Affects Versions: 3.6.4
>Reporter: Stephen Mallette
>Priority: Major
>
> Allow the grammar to support parameters similar to how the groovy engine does 
> like, {{g.inject(x,y,z)}}. Doing this will make it easier for a transition 
> away from the groovy engine as a lot of Gremlin in the world today uses 
> parameters. The grammar may have to come with some limitations though as 
> groovy is wide open in terms of what can be treated as a variable. Probably 
> going to keep parameters tied to primitives, collections and tokens/enums 
> like {{Order}} and {{Scope}}. Collections themselves will not contain 
> parameters and things like a {{Traversal}} or {{P}} cannot be treated as one.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (TINKERPOP-2959) Allow the grammar to support parameters

2023-06-16 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/TINKERPOP-2959?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17733495#comment-17733495
 ] 

ASF GitHub Bot commented on TINKERPOP-2959:
---

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.





> Allow the grammar to support parameters
> ---
>
> Key: TINKERPOP-2959
> URL: https://issues.apache.org/jira/browse/TINKERPOP-2959
> Project: TinkerPop
>  Issue Type: Improvement
>  Components: language
>Affects Versions: 3.6.4
>Reporter: Stephen Mallette
>Priority: Major
>
> Allow the grammar to support parameters similar to how the groovy engine does 
> like, {{g.inject(x,y,z)}}. Doing this will make it easier for a transition 
> away from the groovy engine as a lot of Gremlin in the world today uses 
> parameters. The grammar may have to come with some limitations though as 
> groovy is wide open in terms of what can be treated as a variable. Probably 
> going to keep parameters tied to primitives, collections and tokens/enums 
> like {{Order}} and {{Scope}}. Collections themselves will not contain 
> parameters and things like a {{Traversal}} or {{P}} cannot be treated as one.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (TINKERPOP-2959) Allow the grammar to support parameters

2023-06-16 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/TINKERPOP-2959?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17733514#comment-17733514
 ] 

ASF GitHub Bot commented on TINKERPOP-2959:
---

spmallette commented on PR #2094:
URL: https://github.com/apache/tinkerpop/pull/2094#issuecomment-1594707500

   @vkagamlyk addressed your comments and pushed a new version




> Allow the grammar to support parameters
> ---
>
> Key: TINKERPOP-2959
> URL: https://issues.apache.org/jira/browse/TINKERPOP-2959
> Project: TinkerPop
>  Issue Type: Improvement
>  Components: language
>Affects Versions: 3.6.4
>Reporter: Stephen Mallette
>Priority: Major
>
> Allow the grammar to support parameters similar to how the groovy engine does 
> like, {{g.inject(x,y,z)}}. Doing this will make it easier for a transition 
> away from the groovy engine as a lot of Gremlin in the world today uses 
> parameters. The grammar may have to come with some limitations though as 
> groovy is wide open in terms of what can be treated as a variable. Probably 
> going to keep parameters tied to primitives, collections and tokens/enums 
> like {{Order}} and {{Scope}}. Collections themselves will not contain 
> parameters and things like a {{Traversal}} or {{P}} cannot be treated as one.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (TINKERPOP-2959) Allow the grammar to support parameters

2023-06-16 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/TINKERPOP-2959?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17733554#comment-17733554
 ] 

ASF GitHub Bot commented on TINKERPOP-2959:
---

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




> Allow the grammar to support parameters
> ---
>
> Key: TINKERPOP-2959
> URL: https://issues.apache.org/jira/browse/TINKERPOP-2959
> Project: TinkerPop
>  Issue Type: Improvement
>  Components: language
>Affects Versions: 3.6.4
>Reporter: Stephen Mallette
>Priority: Major
>
> Allow the grammar to support parameters similar to how the groovy engine does 
> like, {{g.inject(x,y,z)}}. Doing this will make it easier for a transition 
> away from the groovy engine as a lot of Gremlin in the world today uses 
> parameters. The grammar may have to come with some limitations though as 
> groovy is wide open in terms of what can be treated as a variable. Probably 
> going to keep parameters tied to primitives, collections and tokens/enums 
> like {{Order}} and {{Scope}}. Collections themselves will not contain 
> parameters and things like a {{Traversal}} or {{P}} cannot be treated as one.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (TINKERPOP-2959) Allow the grammar to support parameters

2023-06-16 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/TINKERPOP-2959?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17733592#comment-17733592
 ] 

ASF GitHub Bot commented on TINKERPOP-2959:
---

Cole-Greer commented on PR #2094:
URL: https://github.com/apache/tinkerpop/pull/2094#issuecomment-1594952371

   LGTM VOTE +1




> Allow the grammar to support parameters
> ---
>
> Key: TINKERPOP-2959
> URL: https://issues.apache.org/jira/browse/TINKERPOP-2959
> Project: TinkerPop
>  Issue Type: Improvement
>  Components: language
>Affects Versions: 3.6.4
>Reporter: Stephen Mallette
>Priority: Major
>
> Allow the grammar to support parameters similar to how the groovy engine does 
> like, {{g.inject(x,y,z)}}. Doing this will make it easier for a transition 
> away from the groovy engine as a lot of Gremlin in the world today uses 
> parameters. The grammar may have to come with some limitations though as 
> groovy is wide open in terms of what can be treated as a variable. Probably 
> going to keep parameters tied to primitives, collections and tokens/enums 
> like {{Order}} and {{Scope}}. Collections themselves will not contain 
> parameters and things like a {{Traversal}} or {{P}} cannot be treated as one.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (TINKERPOP-2959) Allow the grammar to support parameters

2023-06-16 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/TINKERPOP-2959?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17733616#comment-17733616
 ] 

ASF GitHub Bot commented on TINKERPOP-2959:
---

spmallette merged PR #2094:
URL: https://github.com/apache/tinkerpop/pull/2094




> Allow the grammar to support parameters
> ---
>
> Key: TINKERPOP-2959
> URL: https://issues.apache.org/jira/browse/TINKERPOP-2959
> Project: TinkerPop
>  Issue Type: Improvement
>  Components: language
>Affects Versions: 3.6.4
>Reporter: Stephen Mallette
>Priority: Major
>
> Allow the grammar to support parameters similar to how the groovy engine does 
> like, {{g.inject(x,y,z)}}. Doing this will make it easier for a transition 
> away from the groovy engine as a lot of Gremlin in the world today uses 
> parameters. The grammar may have to come with some limitations though as 
> groovy is wide open in terms of what can be treated as a variable. Probably 
> going to keep parameters tied to primitives, collections and tokens/enums 
> like {{Order}} and {{Scope}}. Collections themselves will not contain 
> parameters and things like a {{Traversal}} or {{P}} cannot be treated as one.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)