Unhandled exception. Tomlet.Exceptions.InvalidTomlNumberException: While reading input line 1, found an invalid number literal '0xdeadbeef'
at Tomlet.TomlParser.ReadValue(StringReader reader) in D:\core\CSL\Tomlet\TomlParser.cs:line 235
at Tomlet.TomlParser.ReadKeyValuePair(StringReader reader, String& key, TomlValue& value) in D:\core\CSL\Tomlet\TomlParser.cs:line 108
The Problem
Line 233 in ReadValue in TomlParser.cs assumes a stringValue with an "e" to be an exponential (1e06) and fails on parse.
The Proposed Fix
replace
stringValue.Contains('e') on line 233 in TomlParser.cs
with
(stringValue.Contains('e') && !stringValue.StartsWith("0x"))
to distinguish between exponentials and hex literals
Example
key = 0xdeadbeef
Exception thrown
Unhandled exception. Tomlet.Exceptions.InvalidTomlNumberException: While reading input line 1, found an invalid number literal '0xdeadbeef' at Tomlet.TomlParser.ReadValue(StringReader reader) in D:\core\CSL\Tomlet\TomlParser.cs:line 235 at Tomlet.TomlParser.ReadKeyValuePair(StringReader reader, String& key, TomlValue& value) in D:\core\CSL\Tomlet\TomlParser.cs:line 108
The Problem
Line 233 in
ReadValue
inTomlParser.cs
assumes astringValue
with an "e" to be an exponential (1e06
) and fails on parse.The Proposed Fix
replace
stringValue.Contains('e')
on line 233 in TomlParser.cs with(stringValue.Contains('e') && !stringValue.StartsWith("0x"))
to distinguish between exponentials and hex literals