From 21522f9ed687bbcbb9b2aae0c75aa1c911f451b6 Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Wed, 11 Mar 2015 09:55:38 +0100 Subject: [PATCH] Fix line continuation support for parentheses fixes #8679 --- lib/config/config_lexer.ll | 4 +++- lib/config/config_parser.yy | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/config/config_lexer.ll b/lib/config/config_lexer.ll index e12f2b2c8..25310d650 100644 --- a/lib/config/config_lexer.ll +++ b/lib/config/config_lexer.ll @@ -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; } } <> { if (!yyextra->m_Eof) { yyextra->m_Eof = true; return T_NEWLINE; } else { yyterminate(); } } . return yytext[0]; diff --git a/lib/config/config_parser.yy b/lib/config/config_parser.yy index 5ed34bf53..c09d13ec1 100644 --- a/lib/config/config_parser.yy +++ b/lib/config/config_parser.yy @@ -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(&$$, $1, $3, @1, @3); } -- 2.40.0