External Issue: Toml module redesign

16254, “ankingcodes”, "Toml module redesign ", “2020-08-19T11:13:33Z”

Current Toml implementation cannot differentiate between quotes present in Toml table headers and in key-value pairs. Also, periods present inside quotes of a Toml headers is treated as same as the periods outside the quotes. For example, consider the following toml :

[LocalAtomics."0.1.0"] 
score = "5"

Here, during parsing of TOML file, the "5" is treated same as that of "0.1.0" whereas one of them is a value to a key score and the other is part of a table header. This is due to the use of regex during Toml parsing.

Additionally, after parsing the table header, the subtables are as follows:

[LocalAtomics]
[LocalAtomics."0]
[LocalAtomics."0.1]
[LocalAtomics."0.1.0"]
score = "5"

instead of

[LocalAtomics]
[LocalAtomics."0.1.0"]
score = "5"

This is also due to the use of regex while parsing. The regex cannot differentiate between periods inside & outside of quotes.

#16141 was an effort to fix this issue but we found larger design challenges. For example,
if we create an additional regex to parse [LocalAtomics."0.1.0"] entirely as LocalAtomics."0.1.0" , then the regex would require look-ahead and look-behind features for capturing the value after and behind of opening and closing square brackets which is not yet supported by our Regex module. Another issue would be that the regex would treat table header and array of elements as same.
For example,

[LocalAtomics."0.1.0"]    # regex would capture LocalAtomics."0.1.0" here
tests = [ a.chpl, b.chpl, c.chpl ]   # regex would capture a.chpl, b.chpl, c.chpl here

Therefore, we require to rethink the design of Toml module so that we can fix these errors and also support features that are yet to be implemented ( Array of Tables )