emancu/toml-rb

Cannot parse multi-line array with comment lines

Closed this issue · 1 comments

rsim commented

The following example gives parse exception

>> TOML.parse "array = [\n  1,\n  # 2,\n  3,\n]"
TOML::ParseError: Failed to parse input on line 4 at offset 2
  3,

  ^

but if the indentation leading spaces are removed then there is no parse error

>> TOML.parse "array = [\n1,\n# 2,\n3,\n]"
=> {"array"=>[1, 3]}

This is a common example that indentation spaces are used for multi-line arrays and if you want to comment out some value from the array then you have indentation spaces before comment as well.

Thanks for open a ticket. I'll take care next week.