using var reader = new StringReader("items = [ 'first', 'second ]");
var table = TOML.Parse(reader);
foreach (var element in table["items"].Children.Select(e => e.AsString?.Value))
{
Console.WriteLine($"<{element}>");
}
Notice the missing closing string (') after the second element.
Expected behavior: a TomlParseException is thrown.
Actual behavior: the toml string is parsed and the the following lines are printed on the console:
<first>
<second ]>
Note that parsing is also successful for simple key/value pairs with missing closing string: key = 'value. I think this input should also throw TomlParseException.
Sample code:
Notice the missing closing string (
'
) after thesecond
element.Expected behavior: a
TomlParseException
is thrown.Actual behavior: the toml string is parsed and the the following lines are printed on the console:
Note that parsing is also successful for simple key/value pairs with missing closing string:
key = 'value
. I think this input should also throwTomlParseException
.