Open gregnis opened 4 weeks ago
Can't find a reference about this. https://stackoverflow.com/a/19550081/152142 indicates that there is no spec for this.
If this was supported, then "#" could not be used in setting values (unless it was escaped; is there a standard escape char?).
Also, this directly conflicts with https://github.com/justinmk/tree-sitter-ini/issues/12 .
Need a clear spec one way or the other. Else we're just fumbling around and will do unexpected things depending on the INI "flavor". A spec for each "flavor" would be a starting point.
I was going off https://en.wikipedia.org/wiki/INI_file, the Comments section. I do agree with you about following GetPrivateProfileString as a spec, and if you do that, the current behavior is almost correct. I say "almost" since, if there is a comment symbol in the setting name, like in
an#other-key = another value
it is treated as a comment after and including the '#', which makes the behavior inconsistent.
https://en.wikipedia.org/wiki/INI_file#Comments
... Under the WinAPI's GetPrivateProfileString's dialect, comments must occur on lines by themselves.
This seems the most reasonable. Especially given that escape chars don't seem standard.
OTOH, gitconfig appears to support inline comments, except when quoted in a string?
OTOH, gitconfig appears to support inline comments, except when quoted in a string?
I think this is the most reasonable thing to do, if possible,
In the following example
comments on lines 2 and 3 are not detected whereas all other are:
``