~emersion/public-inbox

1

[scfg] Question about comments

Details
Message ID
<C6WOAAJ4R55M.8AKQ3HAU9971@nitro>
DKIM signature
missing
Download raw message
I want to use scfg to configure a simple stylesheet.
This currently doesn't work, because scfg thinks the colors are
comments:

	style {
		background #000000
		foreground #ffffff
	}

Instead, the colors must be wrapped in quotes, which is somewhat
ugly-looking.

What if comments were only allowed at the beginning of a line?
For example:

	block {
		# This is a comment
		color #000000 This is not a comment
	}

Or perhaps a character other than '#' can be used for comments.
What do you think?
Details
Message ID
<L4adXzIwVO6fRWpiZkDCi2cuMkBn5yQfUvdAzHuDbjIPfEvf6VebRmAgDW-PfUj134JJ1Xy2vZ6Fia6haceEM5dGjglI2pUwRW6OYB0UPsM=@emersion.fr>
In-Reply-To
<C6WOAAJ4R55M.8AKQ3HAU9971@nitro> (view parent)
DKIM signature
fail
Download raw message
DKIM signature: fail
On Saturday, November 7, 2020 3:23 AM, Adnan Maolood <me@adnano.co> wrote:

> I want to use scfg to configure a simple stylesheet.
> This currently doesn't work, because scfg thinks the colors are
> comments:
>
> style {
>     background #000000
>     foreground #ffffff
> }
>
> Instead, the colors must be wrapped in quotes, which is somewhat
> ugly-looking.
>
> What if comments were only allowed at the beginning of a line?
> For example:
>
> block {
>     # This is a comment
>     color #000000 This is not a comment
> }
>
> Or perhaps a character other than '#' can be used for comments.
> What do you think?

Yeah, I think this makes sense. Currently the Go library uses shlex to
split tokens and will stop on any '#', but I think it should migrate to
its own parser instead (like libscfg).

The spec is currently missing comments in its grammar, but the prose
does already say '#' in the middle of a line doesn't start a comment.
Reply to thread Export thread (mbox)