basho / cuttlefish

never lose your childlike sense of wonder baby cuttlefish, promise me?
Apache License 2.0
205 stars 124 forks source link

'#' character within config value [JIRA: RIAK-2547] #167

Open dergraf opened 9 years ago

dergraf commented 9 years ago

According to the 'conf_parse.peg' a comment is specified as any line that begins with a '#' sign (leading whitespace is allowed). However a '#' character appearing within a value (no leading whitespace) is treated as a comment as well. Is this intentional?

1> conf_parse:parse("my.config.val = test/#").
[{["my","config","val"],"test/"}]

PS: my use case is the configuration of a MQTT topic pattern which uses '#' as a wildcard character.

seancribbs commented 9 years ago

Yes, that is intentional, so that trailing comments are allowed. We could potentially tweak the grammar such that you could quote the RHS or escape the #.

dergraf commented 9 years ago

Hi Sean, escaping # would work for me.

RJ commented 8 years ago

I would also like escaping \# or "#quoting", for specifying IRC channel names and rabbitmq paths.

bwegh commented 7 years ago

I also need the support for # in the config value. escpaping \# or "quo#ting" are both okay with me. within quoting then again with support for escpaing of " like "quo#\"ting".