You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by jo...@apache.org on 2017/12/05 13:49:53 UTC
[20/25] tinkerpop git commit: Use invariant culture for numeric
parsing
Use invariant culture for numeric parsing
Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/af6e336c
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/af6e336c
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/af6e336c
Branch: refs/heads/tp32
Commit: af6e336c3c3e58f5980218f5123c5e70ca76a3ae
Parents: 7c9c303
Author: Jorge Bay Gondra <jo...@gmail.com>
Authored: Mon Nov 27 09:10:51 2017 +0100
Committer: Jorge Bay Gondra <jo...@gmail.com>
Committed: Thu Nov 30 10:01:22 2017 +0100
----------------------------------------------------------------------
.../test/Gremlin.Net.IntegrationTest/Gherkin/CommonSteps.cs | 7 ++++---
.../Gherkin/TraversalEvaluation/TraversalParser.cs | 6 ++++--
2 files changed, 8 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/af6e336c/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/CommonSteps.cs
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/CommonSteps.cs b/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/CommonSteps.cs
index 0011eda..0abc247 100644
--- a/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/CommonSteps.cs
+++ b/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/CommonSteps.cs
@@ -24,6 +24,7 @@
using System;
using System.Collections;
using System.Collections.Generic;
+using System.Globalization;
using System.Linq;
using System.Text.RegularExpressions;
using Gherkin.Ast;
@@ -66,9 +67,9 @@ namespace Gremlin.Net.IntegrationTest.Gherkin
{
{ 'i', s => Convert.ToInt32(s) },
{ 'l', s => Convert.ToInt64(s) },
- { 'f', s => Convert.ToSingle(s) },
- { 'd', s => Convert.ToDouble(s) },
- { 'm', s => Convert.ToDecimal(s)}
+ { 'f', s => Convert.ToSingle(s, CultureInfo.InvariantCulture) },
+ { 'd', s => Convert.ToDouble(s, CultureInfo.InvariantCulture) },
+ { 'm', s => Convert.ToDecimal(s, CultureInfo.InvariantCulture) }
};
[Given("the (\\w+) graph")]
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/af6e336c/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/TraversalEvaluation/TraversalParser.cs
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/TraversalEvaluation/TraversalParser.cs b/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/TraversalEvaluation/TraversalParser.cs
index 827960d..118fcea 100644
--- a/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/TraversalEvaluation/TraversalParser.cs
+++ b/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/TraversalEvaluation/TraversalParser.cs
@@ -23,6 +23,7 @@
using System;
using System.Collections.Generic;
+using System.Globalization;
using System.Linq;
using System.Reflection;
using System.Text.RegularExpressions;
@@ -452,12 +453,13 @@ namespace Gremlin.Net.IntegrationTest.Gherkin.TraversalEvaluation
}
if (numericText.EndsWith("F"))
{
- return LiteralParameter.Create(Convert.ToSingle(match.Value.Substring(0, match.Value.Length-1)));
+ return LiteralParameter.Create(Convert.ToSingle(match.Value.Substring(0, match.Value.Length - 1),
+ CultureInfo.InvariantCulture));
}
if (match.Groups[1].Value != "")
{
// Captured text with the decimal separator
- return LiteralParameter.Create(Convert.ToDecimal(match.Value));
+ return LiteralParameter.Create(Convert.ToDecimal(match.Value, CultureInfo.InvariantCulture));
}
return LiteralParameter.Create(Convert.ToInt32(match.Value));
}