Support shell-style comments.

Fixes #5994
This commit is contained in:
Gunnar Beutner 2014-04-10 11:30:01 +02:00
parent eba60b625f
commit e6667c15d3
2 changed files with 3 additions and 2 deletions

View File

@ -420,7 +420,7 @@ Non-empty dictionary | { key = "value" } | true
### <a id="comments"></a> Comments ### <a id="comments"></a> Comments
The Icinga 2 configuration format supports C/C++-style comments. The Icinga 2 configuration format supports C/C++-style and shell-style comments.
Example: Example:
@ -429,7 +429,7 @@ Example:
*/ */
object Host "localhost" { object Host "localhost" {
check_interval = 30 // this is also a comment. check_interval = 30 // this is also a comment.
retry_interval = 15 retry_interval = 15 # yet another comment
} }
### <a id="includes"></a> Includes ### <a id="includes"></a> Includes

View File

@ -196,6 +196,7 @@ static char *lb_steal(lex_buf *lb)
\/\/[^\n]* /* ignore C++-style comments */ \/\/[^\n]* /* ignore C++-style comments */
#[^\n]* /* ignore shell-style comments */
[ \t] /* ignore whitespace */ [ \t] /* ignore whitespace */
<INITIAL>{ <INITIAL>{