You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by "kirill-stepanishin (via GitHub)" <gi...@apache.org> on 2026/07/23 20:35:47 UTC
[PR] [TINKERPOP-3151] Allow floats with no leading digits [tinkerpop]
kirill-stepanishin opened a new pull request, #3558:
URL: https://github.com/apache/tinkerpop/pull/3558
https://issues.apache.org/jira/browse/TINKERPOP-3151
Makes the leading digit optional in float literals, so forms like `.5`, `.5f`, and `.5m` parse, aligning the Gremlin grammar with Groovy.
**Changes**:
- Grammar: added a `DecimalFloatingPointLiteral` alternative for the leading-dot form. Added a `RANGE` : `'..'` token so `1..5` still tokenizes correctly (otherwise `..` gets swallowed into a `.5` float), and pointed `genericLiteralRange` at it, with a matching index fix in `GenericLiteralVisitor`.
- Tests: added `ValidFloatLiteralTest` cases and Gherkin scenarios `g_injectXpoint5X/fX/dX`, plus `g_injectX1to5X` to cover the new `RANGE` token. Regenerated the Python/JS/Go/.NET GLV feature files.
- .NET: ignored `g_injectXpoint5fX` because the .NET translator emits a bare `0.5`, dropping the float type on round-trip (a pre-existing limitation only .NET's strict typing surfaces, not fixing it here).
--
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
Re: [PR] [TINKERPOP-3151] Allow floats with no leading digits [tinkerpop]
Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #3558:
URL: https://github.com/apache/tinkerpop/pull/3558#issuecomment-5063296930
## [Codecov](https://app.codecov.io/gh/apache/tinkerpop/pull/3558?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 77.08%. Comparing base ([`4722890`](https://app.codecov.io/gh/apache/tinkerpop/commit/4722890ed831ba4f71c3916b5e6eafcf85439345?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`e453c90`](https://app.codecov.io/gh/apache/tinkerpop/commit/e453c90b9095229749e3338078bf55aaa8c93f4e?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
:warning: Report is 36 commits behind head on 3.7-dev.
<details><summary>Additional details and impacted files</summary>
```diff
@@ Coverage Diff @@
## 3.7-dev #3558 +/- ##
=============================================
+ Coverage 75.49% 77.08% +1.58%
=============================================
Files 1092 28 -1064
Lines 67208 5336 -61872
Branches 7391 0 -7391
=============================================
- Hits 50742 4113 -46629
+ Misses 13837 1020 -12817
+ Partials 2629 203 -2426
```
</details>
[:umbrella: View full report in Codecov by Harness](https://app.codecov.io/gh/apache/tinkerpop/pull/3558?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
<details><summary> :rocket: New features to boost your workflow: </summary>
- :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
- :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
</details>
--
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
Re: [PR] [TINKERPOP-3151] Allow floats with no leading digits [tinkerpop]
Posted by "xiazcy (via GitHub)" <gi...@apache.org>.
xiazcy commented on PR #3558:
URL: https://github.com/apache/tinkerpop/pull/3558#issuecomment-5064463854
VOTE +1 pending comment resolution
--
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
Re: [PR] [TINKERPOP-3151] Allow floats with no leading digits [tinkerpop]
Posted by "Cole-Greer (via GitHub)" <gi...@apache.org>.
Cole-Greer commented on PR #3558:
URL: https://github.com/apache/tinkerpop/pull/3558#issuecomment-5064854155
VOTE +1, merging as CTR
--
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
Re: [PR] [TINKERPOP-3151] Allow floats with no leading digits [tinkerpop]
Posted by "xiazcy (via GitHub)" <gi...@apache.org>.
xiazcy commented on code in PR #3558:
URL: https://github.com/apache/tinkerpop/pull/3558#discussion_r3641964262
##########
gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/test/features/sideEffect/Inject.feature:
##########
@@ -235,3 +235,51 @@ Feature: Step - inject()
| d[0].n |
| d[-129].n |
| d[-32769].n |
+
+ @GraphComputerVerificationInjectionNotSupported
+ Scenario: g_injectXpoint5X
+ Given the modern graph
+ And the traversal of
+ """
+ g.inject(.5)
+ """
+ When iterated to list
+ Then the result should be unordered
+ | result |
+ | d[0.5].m |
+
+ @GraphComputerVerificationInjectionNotSupported
+ Scenario: g_injectXpoint5fX
+ Given the modern graph
+ And the traversal of
+ """
+ g.inject(.5f)
+ """
+ When iterated to list
+ Then the result should be unordered
+ | result |
+ | d[0.5].f |
+
+ @GraphComputerVerificationInjectionNotSupported
+ Scenario: g_injectXpoint5dX
+ Given the modern graph
+ And the traversal of
+ """
+ g.inject(.5d)
+ """
+ When iterated to list
+ Then the result should be unordered
+ | result |
+ | d[0.5].d |
+
+ @GraphComputerVerificationInjectionNotSupported
+ Scenario: g_injectX1to5X
+ Given the modern graph
+ And the traversal of
+ """
+ g.inject(1..5)
Review Comment:
I wonder if it's worth to also do a string range test like `g.inject("a".."c")` here
--
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
Re: [PR] [TINKERPOP-3151] Allow floats with no leading digits [tinkerpop]
Posted by "kirill-stepanishin (via GitHub)" <gi...@apache.org>.
kirill-stepanishin commented on code in PR #3558:
URL: https://github.com/apache/tinkerpop/pull/3558#discussion_r3642169426
##########
gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/test/features/sideEffect/Inject.feature:
##########
@@ -235,3 +235,51 @@ Feature: Step - inject()
| d[0].n |
| d[-129].n |
| d[-32769].n |
+
+ @GraphComputerVerificationInjectionNotSupported
+ Scenario: g_injectXpoint5X
+ Given the modern graph
+ And the traversal of
+ """
+ g.inject(.5)
+ """
+ When iterated to list
+ Then the result should be unordered
+ | result |
+ | d[0.5].m |
+
+ @GraphComputerVerificationInjectionNotSupported
+ Scenario: g_injectXpoint5fX
+ Given the modern graph
+ And the traversal of
+ """
+ g.inject(.5f)
+ """
+ When iterated to list
+ Then the result should be unordered
+ | result |
+ | d[0.5].f |
+
+ @GraphComputerVerificationInjectionNotSupported
+ Scenario: g_injectXpoint5dX
+ Given the modern graph
+ And the traversal of
+ """
+ g.inject(.5d)
+ """
+ When iterated to list
+ Then the result should be unordered
+ | result |
+ | d[0.5].d |
+
+ @GraphComputerVerificationInjectionNotSupported
+ Scenario: g_injectX1to5X
+ Given the modern graph
+ And the traversal of
+ """
+ g.inject(1..5)
Review Comment:
Added, thanks
--
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
Re: [PR] [TINKERPOP-3151] Allow floats with no leading digits [tinkerpop]
Posted by "Cole-Greer (via GitHub)" <gi...@apache.org>.
Cole-Greer merged PR #3558:
URL: https://github.com/apache/tinkerpop/pull/3558
--
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