提交 34297b7e 编写于 作者: N Neal Gafter 提交者: Jared Parsons

Add RealParser for correct conversion of float and double literals

Fixes #4221
上级 adfea23d
......@@ -1249,7 +1249,7 @@ private ulong GetValueUInt64(string text, bool isHex)
private double GetValueDouble(string text)
{
double result;
if (!Double.TryParse(text, NumberStyles.AllowDecimalPoint | NumberStyles.AllowExponent, CultureInfo.InvariantCulture, out result))
if (!RealParser.TryParseDouble(text, out result))
{
//we've already lexed the literal, so the error must be from overflow
this.AddError(MakeError(ErrorCode.ERR_FloatOverflow, "double"));
......@@ -1261,7 +1261,7 @@ private double GetValueDouble(string text)
private float GetValueSingle(string text)
{
float result;
if (!Single.TryParse(text, NumberStyles.AllowDecimalPoint | NumberStyles.AllowExponent, CultureInfo.InvariantCulture, out result))
if (!RealParser.TryParseFloat(text, out result))
{
//we've already lexed the literal, so the error must be from overflow
this.AddError(MakeError(ErrorCode.ERR_FloatOverflow, "float"));
......
......@@ -35,6 +35,7 @@
<Compile Include="MetadataReferences\AssemblyIdentityExtensions.cs" />
<Compile Include="PEWriter\BlobUtilitiesTests.cs" />
<Compile Include="PEWriter\BlobTests.cs" />
<Compile Include="RealParserTests.cs" />
<Compile Include="SimpleAnalyzerAssemblyLoaderTests.cs" />
<Compile Include="Text\LargeEncodedTextTests.cs" />
<Compile Include="Text\SourceTextStreamTests.cs" />
......
此差异已折叠。
......@@ -56,6 +56,7 @@
<Compile Include="Diagnostic\SuppressionInfo.cs" />
<Compile Include="InternalUtilities\StackGuard.cs" />
<Compile Include="InternalUtilities\StreamExtensions.cs" />
<Compile Include="RealParser.cs" />
<Compile Include="UnicodeCharacterUtilities.cs" />
<Compile Include="CodeAnalysisResources.Designer.cs">
<AutoGen>True</AutoGen>
......
此差异已折叠。
using namespace System;
using namespace System::Reflection;
using namespace System::Runtime::CompilerServices;
using namespace System::Runtime::InteropServices;
using namespace System::Security::Permissions;
//
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
//
[assembly:AssemblyTitleAttribute(L"CLibraryShim")];
[assembly:AssemblyDescriptionAttribute(L"")];
[assembly:AssemblyConfigurationAttribute(L"")];
[assembly:AssemblyCompanyAttribute(L"")];
[assembly:AssemblyProductAttribute(L"CLibraryShim")];
[assembly:AssemblyCopyrightAttribute(L"Copyright (c) 2015")];
[assembly:AssemblyTrademarkAttribute(L"")];
[assembly:AssemblyCultureAttribute(L"")];
//
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the value or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly:AssemblyVersionAttribute("1.0.*")];
[assembly:ComVisible(false)];
[assembly:CLSCompliantAttribute(true)];
\ No newline at end of file
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
#include <stdlib.h> /* strtod, strtof */
#include "CLibraryShim.h"
double CLibraryShim::RealConversions::atod(String^ s)
{
int length = s->Length;
wchar_t *chars = new wchar_t[length + 1];
for (int i = 0; i < length; i++) chars[i] = (*s)[i];
chars[length] = 0;
wchar_t *end = 0;
double d = wcstod(chars, &end);
delete chars;
return d;
}
float CLibraryShim::RealConversions::atof(String^ s)
{
int length = s->Length;
wchar_t *chars = new wchar_t[length + 1];
for (int i = 0; i < length; i++) chars[i] = (*s)[i];
chars[length] = 0;
wchar_t *end = 0;
float f = wcstof(chars, &end);
delete chars;
return f;
}
\ No newline at end of file
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
#pragma once
using namespace System;
namespace CLibraryShim {
public ref class RealConversions
{
public:
static double atod(String^ s);
static float atof(String^ s);
};
}
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{D8C0BD38-F641-4D8E-A2E0-8F89F30531B2}</ProjectGuid>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<Keyword>ManagedCProj</Keyword>
<RootNamespace>CLibraryShim</RootNamespace>
<WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<CLRSupport>true</CLRSupport>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<CLRSupport>true</CLRSupport>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<CLRSupport>true</CLRSupport>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<CLRSupport>true</CLRSupport>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<PrecompiledHeaderFile />
<PrecompiledHeaderOutputFile />
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies />
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeader>Use</PrecompiledHeader>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies />
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PreprocessorDefinitions>WIN32;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeader>Use</PrecompiledHeader>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies />
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeader>Use</PrecompiledHeader>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies />
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="CLibraryShim.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="AssemblyInfo.cpp" />
<ClCompile Include="CLibraryShim.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
\ No newline at end of file
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("RealParserTests")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("RealParserTests")]
[assembly: AssemblyCopyright("Copyright © 2015")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("315bb5ef-73a8-44dd-a6f8-c07680d1e4ff")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.Text;
using static System.Console;
using System.Threading.Tasks;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Microsoft.CodeAnalysis;
[TestClass]
public class RandomRealParserTests
{
[TestMethod]
public void TestRandomDoubleStrings()
{
var start = DateTime.UtcNow;
var nextReport = start + TimeSpan.FromSeconds(10.0);
var elapsed = (DateTime.Now - start);
// compare our atod on random strings against C's strtod
Parallel.For(0, 150, part =>
{
Random r = new Random(start.GetHashCode() + part);
var b = new StringBuilder();
for (int i = 0; i < 100000; i++)
{
b.Clear();
int beforeCount = r.Next(3);
int afterCount = r.Next(1 + part % 50);
int exp = r.Next(-330, 330);
if (beforeCount == 0) b.Append('0');
for (int j = 0; j < beforeCount; j++) b.Append((char)('0' + r.Next(10)));
b.Append('.');
for (int j = 0; j < afterCount; j++) b.Append((char)('0' + r.Next(10)));
b.Append('e');
if (exp >= 0 && r.Next(2) == 0) b.Append('+');
b.Append(exp);
var s = b.ToString();
double d1;
d1 = CLibraryShim.RealConversions.atod(s);
double d2;
if (!RealParser.TryParseDouble(s, out d2)) d2 = 1.0 / 0.0;
Assert.AreEqual(d1, d2, 0.0, $"{s} differ\n RealParser=>{d2:G17}\n atod=>{d1:G17}\n");
}
});
}
[TestMethod]
public void TestRandomFloatStrings()
{
var start = DateTime.UtcNow;
var nextReport = start + TimeSpan.FromSeconds(10.0);
var elapsed = (DateTime.Now - start);
// compare our atof on random strings against C's strtof
Parallel.For(0, 150, part =>
{
Random r = new Random(start.GetHashCode() + part);
var b = new StringBuilder();
for (int i = 0; i < 100000; i++)
{
b.Clear();
int beforeCount = r.Next(3);
int afterCount = r.Next(1 + part % 50);
int exp = r.Next(-50, 40);
if (beforeCount == 0) b.Append('0');
for (int j = 0; j < beforeCount; j++) b.Append((char)('0' + r.Next(10)));
b.Append('.');
for (int j = 0; j < afterCount; j++) b.Append((char)('0' + r.Next(10)));
b.Append('e');
if (exp >= 0 && r.Next(2) == 0) b.Append('+');
b.Append(exp);
var s = b.ToString();
float d1;
d1 = CLibraryShim.RealConversions.atof(s);
float d2;
if (!RealParser.TryParseFloat(s, out d2)) d2 = 1.0f / 0.0f;
Assert.AreEqual(d1, d2, 0.0, $"{s} differ\n RealParser=>{d2:G17}\n atof=>{d1:G17}\n");
}
});
}
}
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{315BB5EF-73A8-44DD-A6F8-C07680D1E4FF}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>RealParserTests</RootNamespace>
<AssemblyName>RealParserTests</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
<ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages</ReferencePath>
<IsCodedUITest>False</IsCodedUITest>
<TestProjectType>UnitTest</TestProjectType>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Numerics" />
</ItemGroup>
<Choose>
<When Condition="('$(VisualStudioVersion)' == '10.0' or '$(VisualStudioVersion)' == '') and '$(TargetFrameworkVersion)' == 'v3.5'">
<ItemGroup>
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
</ItemGroup>
</When>
<Otherwise>
<ItemGroup>
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework" />
</ItemGroup>
</Otherwise>
</Choose>
<ItemGroup>
<Compile Include="..\Core\Portable\RealParser.cs">
<Link>RealParser.cs</Link>
</Compile>
<Compile Include="RandomRealParserTests.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="CLibraryShim\CLibraryShim.vcxproj">
<Project>{d8c0bd38-f641-4d8e-a2e0-8f89f30531b2}</Project>
<Name>CLibraryShim</Name>
</ProjectReference>
</ItemGroup>
<Choose>
<When Condition="'$(VisualStudioVersion)' == '10.0' And '$(IsCodedUITest)' == 'True'">
<ItemGroup>
<Reference Include="Microsoft.VisualStudio.QualityTools.CodedUITestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.TestTools.UITest.Common, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.TestTools.UITest.Extension, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.TestTools.UITesting, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<Private>False</Private>
</Reference>
</ItemGroup>
</When>
</Choose>
<Import Project="$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets" Condition="Exists('$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets')" />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
\ No newline at end of file

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.23107.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RealParserTests", "RealParserTests.csproj", "{315BB5EF-73A8-44DD-A6F8-C07680D1E4FF}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CLibraryShim", "CLibraryShim\CLibraryShim.vcxproj", "{D8C0BD38-F641-4D8E-A2E0-8F89F30531B2}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{315BB5EF-73A8-44DD-A6F8-C07680D1E4FF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{315BB5EF-73A8-44DD-A6F8-C07680D1E4FF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{315BB5EF-73A8-44DD-A6F8-C07680D1E4FF}.Debug|x64.ActiveCfg = Debug|Any CPU
{315BB5EF-73A8-44DD-A6F8-C07680D1E4FF}.Debug|x64.Build.0 = Debug|Any CPU
{315BB5EF-73A8-44DD-A6F8-C07680D1E4FF}.Debug|x86.ActiveCfg = Debug|Any CPU
{315BB5EF-73A8-44DD-A6F8-C07680D1E4FF}.Debug|x86.Build.0 = Debug|Any CPU
{315BB5EF-73A8-44DD-A6F8-C07680D1E4FF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{315BB5EF-73A8-44DD-A6F8-C07680D1E4FF}.Release|Any CPU.Build.0 = Release|Any CPU
{315BB5EF-73A8-44DD-A6F8-C07680D1E4FF}.Release|x64.ActiveCfg = Release|Any CPU
{315BB5EF-73A8-44DD-A6F8-C07680D1E4FF}.Release|x64.Build.0 = Release|Any CPU
{315BB5EF-73A8-44DD-A6F8-C07680D1E4FF}.Release|x86.ActiveCfg = Release|Any CPU
{315BB5EF-73A8-44DD-A6F8-C07680D1E4FF}.Release|x86.Build.0 = Release|Any CPU
{D8C0BD38-F641-4D8E-A2E0-8F89F30531B2}.Debug|Any CPU.ActiveCfg = Debug|Win32
{D8C0BD38-F641-4D8E-A2E0-8F89F30531B2}.Debug|x64.ActiveCfg = Debug|x64
{D8C0BD38-F641-4D8E-A2E0-8F89F30531B2}.Debug|x64.Build.0 = Debug|x64
{D8C0BD38-F641-4D8E-A2E0-8F89F30531B2}.Debug|x86.ActiveCfg = Debug|Win32
{D8C0BD38-F641-4D8E-A2E0-8F89F30531B2}.Debug|x86.Build.0 = Debug|Win32
{D8C0BD38-F641-4D8E-A2E0-8F89F30531B2}.Release|Any CPU.ActiveCfg = Release|Win32
{D8C0BD38-F641-4D8E-A2E0-8F89F30531B2}.Release|x64.ActiveCfg = Release|x64
{D8C0BD38-F641-4D8E-A2E0-8F89F30531B2}.Release|x64.Build.0 = Release|x64
{D8C0BD38-F641-4D8E-A2E0-8F89F30531B2}.Release|x86.ActiveCfg = Release|Win32
{D8C0BD38-F641-4D8E-A2E0-8F89F30531B2}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
......@@ -1890,14 +1890,14 @@ FullWidthRepeat2:
If TypeCharacter = TypeCharacter.Single OrElse TypeCharacter = TypeCharacter.SingleLiteral Then
' // Attempt to convert to single
Dim SingleValue As Single
If Not Single.TryParse(LiteralSpelling, NumberStyles.Float, CultureInfo.InvariantCulture, SingleValue) Then
If Not RealParser.TryParseFloat(LiteralSpelling, SingleValue) Then
Overflows = True
Else
FloatingValue = SingleValue
End If
Else
' // Attempt to convert to double.
If Not Double.TryParse(LiteralSpelling, NumberStyles.Float, CultureInfo.InvariantCulture, FloatingValue) Then
If Not RealParser.TryParseDouble(LiteralSpelling, FloatingValue) Then
Overflows = True
End If
End If
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册