You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by sp...@apache.org on 2021/12/27 21:00:27 UTC

[tinkerpop] 01/01: Merge pull request #1516 from apache/TINKERPOP-2663

This is an automated email from the ASF dual-hosted git repository.

spmallette pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tinkerpop.git

commit 64b1b30eef3243666226d6d4aeb3e1d892936b74
Merge: 31d2669 34ab339
Author: stephen mallette <sp...@users.noreply.github.com>
AuthorDate: Mon Dec 27 16:00:18 2021 -0500

    Merge pull request #1516 from apache/TINKERPOP-2663
    
    TINKERPOP-2663 Allowed for Vertex/ReferenceVertex in grammar

 CHANGELOG.asciidoc                                 |  1 +
 docs/src/dev/developer/for-committers.asciidoc     |  3 +
 .../language/grammar/GenericLiteralVisitor.java    | 22 +++++---
 .../language/grammar/GremlinBaseVisitor.java       | 20 ++++++-
 .../grammar/GremlinStringConstantsVisitor.java     |  9 ++-
 .../language/grammar/StructureElementVisitor.java  | 43 +++++++++++++++
 .../language/grammar/TraversalFunctionVisitor.java | 10 +++-
 .../language/grammar/TraversalMethodVisitor.java   | 64 +++++++++++++---------
 .../grammar/TraversalPredicateVisitor.java         | 20 +++++--
 .../grammar/TraversalSourceSelfMethodVisitor.java  | 16 +++---
 .../traversal/translator/GroovyTranslator.java     | 34 ++++++++++++
 .../grammar/GeneralLiteralVisitorTest.java         | 49 +++++++++--------
 .../grammar/StructureElementVisitorTest.java       | 48 ++++++++++++++++
 .../grammar/TraversalPredicateVisitorTest.java     |  2 +-
 .../traversal/translator/GroovyTranslatorTest.java | 13 ++++-
 gremlin-language/src/main/antlr4/Gremlin.g4        | 22 ++++++--
 16 files changed, 295 insertions(+), 81 deletions(-)

diff --cc CHANGELOG.asciidoc
index 55c7d57,135ea68..2bb5777
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@@ -36,12 -34,10 +36,13 @@@ image::https://raw.githubusercontent.co
  * Improved behavior of `V()` and `E()` when `null` is an argument producing a filtering behavior rather than an exception.
  * Prevented metrics computation unless the traversal is in a locked state.
  * Added syntax to Gremlin grammar to explicitly define `byte`, `short` and `BigInteger`.
+ * Added syntax to Gremlin grammar to allow construction of a reference `Vertex`.
  * Created a way to produce a corpus of Gremlin traversals via `FeatureReader` and `DocumentationReader` in `gremlin-language`.
 +* Changed mechanism for determining if `id` equality with `toString()` is used by validating that elements of the predicate collection are all `String` rather than enforcing homogenous collections in the process.
  * Exposed Gherkin tests as part of the provider test suite.
  * Packaged Gherkin tests and data as standalone package as a convenience distribution.
 +* Removed `ProductiveByStrategy` as a strategy that is applied by default.
 +* Changed `by()` modulator semantics to consistently filter.
  * Removed previously deprecated `application/vnd.gremlin-v1.0+gryo-lite` serialization format.
  * Removed previously deprecated `AuthenticationSettings.enableAuditLog`.
  * Removed previously deprecated `GroovyTranslator` from `gremlin-groovy` module.
diff --cc gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/grammar/TraversalMethodVisitor.java
index 7682232,aaa36a8..fac55d6
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/grammar/TraversalMethodVisitor.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/grammar/TraversalMethodVisitor.java
@@@ -454,24 -453,8 +454,24 @@@ public class TraversalMethodVisitor ext
       * {@inheritDoc}
       */
      @Override
 +    public Traversal visitTraversalMethod_fail_Empty(final GremlinParser.TraversalMethod_fail_EmptyContext ctx) {
 +        return this.graphTraversal.fail();
 +    }
 +
 +    /**
 +     * {@inheritDoc}
 +     */
 +    @Override
 +    public Traversal visitTraversalMethod_fail_String(final GremlinParser.TraversalMethod_fail_StringContext ctx) {
 +        return this.graphTraversal.fail(GenericLiteralVisitor.getStringLiteral(ctx.stringLiteral()));
 +    }
 +
 +    /**
 +     * {@inheritDoc}
 +     */
 +    @Override
      public GraphTraversal visitTraversalMethod_filter_Predicate(final GremlinParser.TraversalMethod_filter_PredicateContext ctx) {
-         return graphTraversal.filter(TraversalPredicateVisitor.getInstance().visitTraversalPredicate(ctx.traversalPredicate()));
+         return graphTraversal.filter(TraversalPredicateVisitor.instance().visitTraversalPredicate(ctx.traversalPredicate()));
      }
  
      /**