You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there a way to retrieve the line in which a toml element is located? For example, how can I find out the list line?
vartoml=@"global = ""this is a string""# This is a comment of a table[my_table]key = 1 # Comment a keyvalue = truelist = [4, 5, 6]";// Converts the TOML string to a `TomlTable`varmodel=Toml.ToModel(toml);// Prints "this is a string"Console.WriteLine(model["global"]);
Is it possible to retrieve a line from a tomlArray...etc?
The text was updated successfully, but these errors were encountered:
Line is accessible by parsing (but not converting to a model) and then through DocumentSyntax, you can access the Span property of the various elements. The model is a step that is compressing the information and would not be able to recover all the details that you get through the syntax model.
TomlTable.PropertiesMetadata.TryGetProperty provides TomlPropertyMetadata which has .Span, which is a SourceSpan. This will give you the line for list. This was added to main recently, so probably the next release?
Hey there,
Thanks for your awesome Toml parser.
Is there a way to retrieve the line in which a toml element is located? For example, how can I find out the
list
line?Is it possible to retrieve a line from a tomlArray...etc?
The text was updated successfully, but these errors were encountered: