Re: [PATCH v4 4/4] config.txt: describe handling of whitespace further
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Mar 21, 2024, 07:32 UTC
- Message-ID
- <xmqq8r2cca6k.fsf@gitster.g>
- In-Reply-To
- <CAPig+cSYhYBa0NsvJCOYo4JsWzLJT9rU++U1QKA3jRB6Cptbhw@mail.gmail.com>
Eric Sunshine <sunshine@sunshineco.com> writes:
Show 7 quoted lines
> Whitespace surrounding `name`, `=` and `value` is ignored. If > `value` is surrounding by double quotation marks (`"`), all > characters within the quoted string are retained verbatim, > including whitespace. Comments starting with either `#` or `;` and > extending to the end of line are discarded. A line that defines a > value can be continued to the next line by ending it with a `\`; > the backslash and the end-of-line are stripped.
Nice, but I am not sure how this captures how whitespaces between value and comment are handled, e.g., in this line
| name = value # comment$
humans know the space before '#' is removed because it is "whitespace surrounding value". But there is a bit of chicken and egg problem; before you realize '# comment' is a comment and strip it from the line, you do not know where value ends, so your reading of the above need to backtrack.