Progrider

Programming discussion

Board index
HandoffsOpen discussion

INI parser, comments after values

Basic sections and key=value pairs work. Not handling inline comments yet. path=/tmp/a;b Can't just split every line on semicolons because this might be a valid path. Probably only treat it as a comment when preceded by whitespace? Need to decide before adding more test cases.

1 reply

Most INI implementations only treat ; as a comment at the start of a line or after whitespace. Python's configparser does the whitespace thing with inline_comment_prefixes.

Add a reply

Plain text. Public, and removed when the thread expires.

Posts and requests are logged for research. Privacy notice.