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

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

vkagamlyk commented on code in PR #2640:
URL: https://github.com/apache/tinkerpop/pull/2640#discussion_r1628455738


##########
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/grammar/TraversalMethodVisitor.java:
##########


Review Comment:
   `visitTraversalMethod_option_Merge_Map_Cardinality` have middle argument 
(Map) defined in grammar as `genericLiteralMapNullableArgument`, but we handle 
only  `genericLiteralMap` and `nullLiteral` cases, not `variable`.
   
      ```
    @Override
       public Traversal visitTraversalMethod_option_Merge_Map_Cardinality(final 
GremlinParser.TraversalMethod_option_Merge_Map_CardinalityContext ctx) {
           if (ctx.genericLiteralMapNullableArgument().nullLiteral() != null) {
               return 
this.graphTraversal.option(antlr.argumentVisitor.parseMerge(ctx.traversalMergeArgument()),
 (Map) null);
           }
   
           // proposed addition
           if (ctx.genericLiteralMapNullableArgument().variable() != null) {
               return 
graphTraversal.option(antlr.argumentVisitor.parseMerge(ctx.traversalMergeArgument()),
                       (Map) 
antlr.argumentVisitor.visitVariable(ctx.genericLiteralMapNullableArgument().variable()),
                       
TraversalEnumParser.parseTraversalEnumFromContext(Cardinality.class, 
ctx.traversalCardinality()));
           }
           // end of proposed addition
   
           return 
graphTraversal.option(antlr.argumentVisitor.parseMerge(ctx.traversalMergeArgument()),
                   (Map) new 
GenericLiteralVisitor(antlr).visitGenericLiteralMap(ctx.genericLiteralMapNullableArgument().genericLiteralMap()),
                   
TraversalEnumParser.parseTraversalEnumFromContext(Cardinality.class, 
ctx.traversalCardinality()));
       }
   ```
   
   
   





> Convert translators to make use of the grammar
> ----------------------------------------------
>
>                 Key: TINKERPOP-3028
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-3028
>             Project: TinkerPop
>          Issue Type: Improvement
>          Components: translator
>    Affects Versions: 3.6.6
>            Reporter: Stephen Mallette
>            Assignee: Stephen Mallette
>            Priority: Major
>
> {{Translator}} infrastructure uses bytecode and reflection which has a number 
> of technical imperfections and exemptions for it to work properly. Switching 
> to the grammar for translation simplifies the code, removes friction and 
> complexity when generating GLV tests, and should perform better. The focus 
> for this issue is the Java series of translators which are relied on quite 
> heavily. 



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

Reply via email to