]> granicus.if.org Git - icinga2/commitdiff
Fix line continuation support for parentheses
authorGunnar Beutner <gunnar@beutner.name>
Wed, 11 Mar 2015 08:55:38 +0000 (09:55 +0100)
committerGunnar Beutner <gunnar@beutner.name>
Wed, 11 Mar 2015 08:55:38 +0000 (09:55 +0100)
fixes #8679

lib/config/config_lexer.ll
lib/config/config_parser.yy

index e12f2b2c893c81cad06ab7ecc572351c368ddbe8..25310d6505f0e0a1f8116dcdede21dc1ffb5d7cf 100644 (file)
@@ -251,7 +251,9 @@ in                          return T_IN;
 \>                             return T_GREATER_THAN;
 }
 
-[\r\n]+                                { yycolumn -= strlen(yytext) - 1; if (!yyextra->m_IgnoreNewlines) return T_NEWLINE; }
+\(                             { yyextra->m_IgnoreNewlines++; return '('; }
+\)                             { yyextra->m_IgnoreNewlines--; return ')'; }
+[\r\n]+                                { yycolumn -= strlen(yytext) - 1; if (!yyextra->m_IgnoreNewlines) { return T_NEWLINE; } }
 <<EOF>>                                { if (!yyextra->m_Eof) { yyextra->m_Eof = true; return T_NEWLINE; } else { yyterminate(); } }
 .                              return yytext[0];
 
index 5ed34bf53113cc947be7bb6643a4503fc0c60a1f..c09d13ec1fd6cbdbaaa4777b1fe12ceb78b527cb 100644 (file)
@@ -907,11 +907,11 @@ rterm_no_side_effect: T_STRING
        }
        | '('
        {
-               context->m_IgnoreNewlines++;
+               context->m_OpenBraces++;
        }
        rterm ')'
        {
-               context->m_IgnoreNewlines--;
+               context->m_OpenBraces--;
                $$ = $3;
        }
        | rterm T_LOGICAL_OR rterm { MakeRBinaryOp<LogicalOrExpression>(&$$, $1, $3, @1, @3); }