← Back to context

Comment by jpc0

4 days ago

So what happens when the env value happens to actually have a # in it?

So you then need to implement escaping which can go from a very simple implementation to an actual lookahead parser

EDIT:

Actually I agree, this parser is already very overbuilt and should be able to handle comments. Generally an env parser is a few lines a best… you need to read a line, look for the first instance of the separator, generally no reason to build a full parser for that, env is an absurdly simple format if you don’t want features like comments.

Hell even an ini format parser is simple to implement in the same style.