Skip to content

Can comments appear before commas in in-line arrays? #766

@Validark

Description

@Validark

Arrays can span multiple lines. A terminating comma (also called trailing comma) is ok after the last value of the array. There can be an arbitrary number of newlines and comments before a value and before the closing bracket.

My question is this: Can comments appear before commas in in-line arrays?

integers3 = [
  1,
  2 # is this a valid toml document?
  , 3
]

According to the ABNF file, the above is not a valid toml document.

However, tomlplusplus parses the above document just fine: https://godbolt.org/z/f6MG38

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions