[
https://issues.apache.org/jira/browse/TINKERPOP-3236?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18067869#comment-18067869
]
ASF GitHub Bot commented on TINKERPOP-3236:
-------------------------------------------
Cole-Greer commented on code in PR #3331:
URL: https://github.com/apache/tinkerpop/pull/3331#discussion_r2978398656
##########
gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/language/grammar/ArgumentVisitorTest.java:
##########
@@ -178,7 +178,7 @@ public void shouldParse() {
});
} else if (clazz.equals(Float.class)) {
assertParsing(() -> {
- final GremlinParser.FloatArgumentContext ctx =
parser.floatArgument();
+ final GremlinParser.NumericArgumentContext ctx =
parser.numericArgument();
Review Comment:
Added a feature test for `g.V().coin(1)`
> Limit use of FloatLiteral as step arguments in grammar
> ------------------------------------------------------
>
> Key: TINKERPOP-3236
> URL: https://issues.apache.org/jira/browse/TINKERPOP-3236
> Project: TinkerPop
> Issue Type: Improvement
> Components: language
> Affects Versions: 3.7.5
> Reporter: Cole Greer
> Assignee: Cole Greer
> Priority: Major
> Fix For: 3.7.6, 3.8.1
>
>
> There are currently 2 steps which accept FloatLiterals in the grammar as
> opposed to NumericLiterals, coin() and pagerank(). The effect of this is that
> any "integer-like" number cannot be passed to these steps in gremlin-lang
> scripts, despite them being acceptable in groovy and other languages.
> For example coin(1.0), coin(1D), and coin(1F) are all parseable, but running
> coin(1) through the grammar will throw a parsing exception.
> This constraint becomes especially problematic with gremlin-javascript in
> TinkerPop 4 as JS is unable to distinguish the numbers 1.0 and 1, and thus
> must generate scripts such as coin(1).
--
This message was sent by Atlassian Jira
(v8.20.10#820010)