diff --git a/BeefLibs/Beefy2D/src/utils/StructuredData.bf b/BeefLibs/Beefy2D/src/utils/StructuredData.bf index b576ad56..9c750ed9 100644 --- a/BeefLibs/Beefy2D/src/utils/StructuredData.bf +++ b/BeefLibs/Beefy2D/src/utils/StructuredData.bf @@ -506,11 +506,11 @@ namespace Beefy.utils case typeof(Int64): return (.)(int64)val; case typeof(Int): return (.)(int)val; case typeof(String): - if (int32.Parse((String)val) case .Ok(var fVal)) + if (int32.Parse((String)val, .AllowHexSpecifier) case .Ok(var fVal)) return (.)fVal; return defaultVal; case typeof(StringView): - if (int32.Parse((StringView)val) case .Ok(var fVal)) + if (int32.Parse((StringView)val, .AllowHexSpecifier) case .Ok(var fVal)) return (.)fVal; return defaultVal; default: return defaultVal; @@ -529,11 +529,11 @@ namespace Beefy.utils case typeof(Int64): return (.)(int64)val; case typeof(Int): return (.)(int)val; case typeof(String): - if (int64.Parse((String)val) case .Ok(var parsedVal)) + if (int64.Parse((String)val, .AllowHexSpecifier) case .Ok(var parsedVal)) return (.)parsedVal; return defaultVal; case typeof(StringView): - if (int64.Parse((StringView)val) case .Ok(var parsedVal)) + if (int64.Parse((StringView)val, .AllowHexSpecifier) case .Ok(var parsedVal)) return (.)parsedVal; return defaultVal; default: return defaultVal; @@ -552,11 +552,11 @@ namespace Beefy.utils case typeof(Int64): return (.)(int64)val; case typeof(Int): return (.)(int)val; case typeof(String): - if (int64.Parse((String)val) case .Ok(var parsedVal)) + if (int64.Parse((String)val, .AllowHexSpecifier) case .Ok(var parsedVal)) return (.)parsedVal; return defaultVal; case typeof(StringView): - if (int64.Parse((StringView)val) case .Ok(var parsedVal)) + if (int64.Parse((StringView)val, .AllowHexSpecifier) case .Ok(var parsedVal)) return (.)parsedVal; return defaultVal; default: return defaultVal; @@ -1841,7 +1841,7 @@ namespace Beefy.utils } else { - var parseVal = int64.Parse(strView); + var parseVal = int64.Parse(strView, .AllowHexSpecifier); if (parseVal case .Ok(var intVal)) aValue = new:mBumpAllocator box intVal; else @@ -2242,7 +2242,7 @@ namespace Beefy.utils } } - switch (Int64.Parse(value)) + switch (Int64.Parse(value, .AllowHexSpecifier)) { case .Err: return null; case .Ok(let num): return new:mBumpAllocator box num; diff --git a/BeefLibs/corlib/src/Globalization/NumberFormatInfo.bf b/BeefLibs/corlib/src/Globalization/NumberFormatInfo.bf index d97b1272..a4f78b1c 100644 --- a/BeefLibs/corlib/src/Globalization/NumberFormatInfo.bf +++ b/BeefLibs/corlib/src/Globalization/NumberFormatInfo.bf @@ -692,11 +692,11 @@ namespace System.Globalization { } // private const NumberStyles InvalidNumberStyles = unchecked((NumberStyles) 0xFFFFFC00); - private const NumberStyles InvalidNumberStyles = ~(NumberStyles.AllowLeadingWhite | NumberStyles.AllowTrailingWhite - | NumberStyles.AllowLeadingSign | NumberStyles.AllowTrailingSign - | NumberStyles.AllowParentheses | NumberStyles.AllowDecimalPoint - | NumberStyles.AllowThousands | NumberStyles.AllowExponent - | NumberStyles.AllowCurrencySymbol | NumberStyles.AllowHexSpecifier); + private const NumberStyles InvalidNumberStyles = ~(.AllowLeadingWhite | .AllowTrailingWhite + | .AllowLeadingSign | .AllowTrailingSign + | .AllowParentheses | .AllowDecimalPoint + | .AllowThousands | .AllowExponent + | .AllowCurrencySymbol | .AllowHexSpecifier | .Hex); /*internal static void ValidateParseStyleInteger(NumberStyles style) { // Check for undefined flags diff --git a/BeefLibs/corlib/src/Globalization/NumberStyles.bf b/BeefLibs/corlib/src/Globalization/NumberStyles.bf index 5fbba392..6dce1b09 100644 --- a/BeefLibs/corlib/src/Globalization/NumberStyles.bf +++ b/BeefLibs/corlib/src/Globalization/NumberStyles.bf @@ -45,10 +45,11 @@ namespace System.Globalization AllowHexSpecifier = 0x00000200, //Allow specifiying hexadecimal. //Common uses. These represent some of the most common combinations of these flags. + Hex = 0x00000400, Integer = AllowLeadingWhite | AllowTrailingWhite | AllowLeadingSign, - HexNumber = AllowLeadingWhite | AllowTrailingWhite | AllowHexSpecifier, + HexNumber = AllowLeadingWhite | AllowTrailingWhite | AllowHexSpecifier | Hex, Number = AllowLeadingWhite | AllowTrailingWhite | AllowLeadingSign | AllowTrailingSign | AllowDecimalPoint | AllowThousands, diff --git a/BeefLibs/corlib/src/Int16.bf b/BeefLibs/corlib/src/Int16.bf index 7dc7c352..425a8c3c 100644 --- a/BeefLibs/corlib/src/Int16.bf +++ b/BeefLibs/corlib/src/Int16.bf @@ -85,7 +85,7 @@ namespace System bool isNeg = false; int16 result = 0; - int16 radix = style.HasFlag(.AllowHexSpecifier) ? 0x10 : 10; + int16 radix = style.HasFlag(.Hex) ? 0x10 : 10; for (int32 i = 0; i < val.Length; i++) { diff --git a/BeefLibs/corlib/src/Int32.bf b/BeefLibs/corlib/src/Int32.bf index 2cb54301..7cef1110 100644 --- a/BeefLibs/corlib/src/Int32.bf +++ b/BeefLibs/corlib/src/Int32.bf @@ -134,7 +134,7 @@ namespace System bool isNeg = false; int32 result = 0; - int32 radix = style.HasFlag(.AllowHexSpecifier) ? 0x10 : 10; + int32 radix = style.HasFlag(.Hex) ? 0x10 : 10; for (int32 i = 0; i < val.Length; i++) { diff --git a/BeefLibs/corlib/src/Int64.bf b/BeefLibs/corlib/src/Int64.bf index b40c75c2..589c7ae2 100644 --- a/BeefLibs/corlib/src/Int64.bf +++ b/BeefLibs/corlib/src/Int64.bf @@ -115,7 +115,7 @@ namespace System bool isNeg = false; int64 result = 0; - int64 radix = style.HasFlag(.AllowHexSpecifier) ? 0x10 : 10; + int64 radix = style.HasFlag(.Hex) ? 0x10 : 10; for (int32 i = 0; i < val.Length; i++) { diff --git a/BeefLibs/corlib/src/Int8.bf b/BeefLibs/corlib/src/Int8.bf index 57f900ea..d4a10594 100644 --- a/BeefLibs/corlib/src/Int8.bf +++ b/BeefLibs/corlib/src/Int8.bf @@ -85,7 +85,7 @@ namespace System bool isNeg = false; int8 result = 0; - int8 radix = style.HasFlag(.AllowHexSpecifier) ? 0x10 : 10; + int8 radix = style.HasFlag(.Hex) ? 0x10 : 10; for (int32 i = 0; i < val.Length; i++) { diff --git a/BeefLibs/corlib/src/UInt16.bf b/BeefLibs/corlib/src/UInt16.bf index 44a708fe..bd9b8b9f 100644 --- a/BeefLibs/corlib/src/UInt16.bf +++ b/BeefLibs/corlib/src/UInt16.bf @@ -85,7 +85,7 @@ namespace System uint16 result = 0; uint16 prevResult = 0; - uint16 radix = style.HasFlag(.AllowHexSpecifier) ? 0x10 : 10; + uint16 radix = style.HasFlag(.Hex) ? 0x10 : 10; for (int32 i = 0; i < val.Length; i++) { diff --git a/BeefLibs/corlib/src/UInt32.bf b/BeefLibs/corlib/src/UInt32.bf index 780ef52d..c6705be7 100644 --- a/BeefLibs/corlib/src/UInt32.bf +++ b/BeefLibs/corlib/src/UInt32.bf @@ -113,7 +113,7 @@ namespace System uint32 result = 0; uint32 prevResult = 0; - uint32 radix = style.HasFlag(.AllowHexSpecifier) ? 0x10 : 10; + uint32 radix = style.HasFlag(.Hex) ? 0x10 : 10; for (int32 i = 0; i < val.Length; i++) { diff --git a/BeefLibs/corlib/src/UInt64.bf b/BeefLibs/corlib/src/UInt64.bf index 645ae2a0..223a212d 100644 --- a/BeefLibs/corlib/src/UInt64.bf +++ b/BeefLibs/corlib/src/UInt64.bf @@ -97,7 +97,7 @@ namespace System uint64 result = 0; uint64 prevResult = 0; - uint64 radix = style.HasFlag(.AllowHexSpecifier) ? 0x10 : 10; + uint64 radix = style.HasFlag(.Hex) ? 0x10 : 10; for (int32 i = 0; i < val.Length; i++) { diff --git a/BeefLibs/corlib/src/UInt8.bf b/BeefLibs/corlib/src/UInt8.bf index cee59e80..32c0e8aa 100644 --- a/BeefLibs/corlib/src/UInt8.bf +++ b/BeefLibs/corlib/src/UInt8.bf @@ -85,7 +85,7 @@ namespace System uint8 result = 0; uint8 prevResult = 0; - uint8 radix = style.HasFlag(.AllowHexSpecifier) ? 0x10 : 10; + uint8 radix = style.HasFlag(.Hex) ? 0x10 : 10; for (int32 i = 0; i < val.Length; i++) {