Add splitByElement() method for parsing nested list or set#3216
Add splitByElement() method for parsing nested list or set#3216yunlingTao wants to merge 1 commit intoapache:3.8-devfrom
Conversation
8cda37a to
04913fe
Compare
04913fe to
4b7928e
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## 3.8-dev #3216 +/- ##
==========================================
Coverage ? 76.77%
Complexity ? 14942
==========================================
Files ? 1159
Lines ? 72502
Branches ? 8041
==========================================
Hits ? 55667
Misses ? 13816
Partials ? 3019 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| return String.format("\"%s\"", pvalue); | ||
| } | ||
|
|
||
| private List<String> splitByElement(String s) { |
There was a problem hiding this comment.
Would be good to add a scenario to a feature test would would execute this new logic. Perhaps adding a scenario to the Fold.feature which does something like g.V().fold().fold() which will result in a list of lists?
There was a problem hiding this comment.
Do other GLVs need a similar change? For example the parsing logic for lists and sets in feature-steps.js and feature_steps.py.
…n parsing
Naive split(",") breaks on nested collection tokens like l[1,2,3] inside
s[l[1,2,3],l[4,5,6]]. Adds a bracket-depth-aware splitByElement() helper to
all Gherkin step definition files across Java and every GLV, so that commas
inside nested brackets are not treated as top-level separators.
Also adds two new Gherkin scenarios to Fold.feature that exercise nested
list-of-list results (g.inject([1,2],[3,4]).fold()), along with the
corresponding traversal bindings in each GLV's translation map.
Java implementation follows PR #3216.
(tinkerpop-mxr, tinkerpop-32y, tinkerpop-ghp, tinkerpop-2ur, tinkerpop-70k, tinkerpop-188, tinkerpop-93a)
|
Closing in favor of #3379 which extends this to all GLVs and adds Gherkin scenarios. |
Added
splitByElement()method ingremlin-testwhich splits strings without breaking elements containing commas inside brackets or braces.It replaces
split(",")in list and set parsing to handle structures likes[l[1,2,3], l[2,3,4]].