summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--conf/cf-lex.l14
1 files changed, 13 insertions, 1 deletions
diff --git a/conf/cf-lex.l b/conf/cf-lex.l
index 9bbb3660..920d258e 100644
--- a/conf/cf-lex.l
+++ b/conf/cf-lex.l
@@ -112,7 +112,7 @@ static int check_eof(void);
%option nounput
%option noreject
-%x COMMENT CCOMM CLI
+%x COMMENT CCOMM CLI MULTISTRING
ALPHA [a-zA-Z_]
DIGIT [0-9]
@@ -308,6 +308,18 @@ else: {
return TEXT;
}
+\"\"\" BEGIN(MULTISTRING);
+<MULTISTRING>\"\"\" {
+ yytext[yyleng-3] = 0;
+ cf_lval.t = cfg_strdup(yytext);
+ yytext[yyleng-3] = '\"';
+ BEGIN(INITIAL);
+ return TEXT;
+}
+<MULTISTRING><<EOF>> cf_error("Unterminated multi-line string");
+<MULTISTRING>\n ifs->lino++; ifs->chno = 0; yymore();
+<MULTISTRING>. yymore();
+
["][^"\n]*\n cf_error("Unterminated string");
<INITIAL,COMMENT><<EOF>> { if (check_eof()) return END; }