A parser library (JSONC, YAML, TOML) should optionally let you parse comments — what you do with them is your prerogative.
Yes, your job is to parse
52.7%
No, throw comments away
15%
It's complicated
32.3%
Poll ended at .
@fasterthanlime the main use case for this is preserving comments and formatting when editing, so you would also need to preserve formatting and then the kind of thing your parser returns becomes very different. I don't think encouraging use of comments to convey information to the program is a good idea either