shakeelmohamed / sublime-splunk-conf-highlighting

Syntax highlighting for Splunk .conf files in Sublime Text 2 & 3
https://packagecontrol.io/packages/Splunk%20Conf%20File%20Syntax%20Highlighting
MIT License
11 stars 6 forks source link

Add * comments as a pattern #4

Open shakeelmohamed opened 8 years ago

shakeelmohamed commented 8 years ago

Many .conf files contain lines like:

[stanza1]
key = value
* some description about this key,
and the description continues here as well.

another_key = the \
*value continues here, due to the slash
* but this is a comment
and so is this
this = is a continued comment
shakeelmohamed commented 8 years ago

The regex for this is similar to to what's used for settings. Block comment ends with:

mkldon commented 8 years ago

I don't think such comments syntax is supported, it is not documented and is not used in splunk default conf files in /etc dir.

shakeelmohamed commented 8 years ago

@mkldon It may not be documented, but it's definitely a common practice if you look at the .conf.spec files shipped in Splunk or apps

mkldon commented 8 years ago

Well, spec files are not realy conf files, they are just a documentation. I think * comment may be a valid syntax for multiline setting in conf file. Example: search = \ * | stats count

shakeelmohamed commented 8 years ago

Well, spec files are not realy conf files, they are just a documentation.

We can debate this for eternity, but spec files are definitely more than just documentation. Your example would be correctly parsed as with the value \\n* | stats count, this is a good edge case though. I suppose we could actually add another syntax definition just for spec files, but that seems silly.

Either way, these kinds of comments appear in spec files and regular conf files.