From: Tomek Mrugalski Date: Thu, 29 Oct 2015 00:13:14 +0000 (+0100) Subject: [4088] string handling improved. X-Git-Tag: trac4088fd_base~15 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=eef1e61ffff014e0d2a3df2178114822ae68e3c1;p=thirdparty%2Fkea.git [4088] string handling improved. --- diff --git a/src/lib/eval/lexer.ll b/src/lib/eval/lexer.ll index e79d229415..4c88704120 100644 --- a/src/lib/eval/lexer.ll +++ b/src/lib/eval/lexer.ll @@ -19,6 +19,7 @@ static isc::eval::location loc; %option noyywrap nounput batch debug noinput int [0-9]+ blank [ \t] +str [a-zA-Z_0-9]* %{ // Code run each time a pattern is matched. @@ -35,9 +36,13 @@ blank [ \t] {blank}+ loc.step(); [\n]+ loc.lines(yyleng); loc.step(); -\'[a-zA-Z_0-9]*\' { - // This is a string, no need to do any conversions here. - return isc::eval::EvalParser::make_STRING(yytext, loc); +\'{str}\' { + // This is a string. It contains the actual string and single quotes. + // We need to get those quotes out of the way. + std::string tmp(yytext+1); + tmp.resize(tmp.size() - 1); + + return isc::eval::EvalParser::make_STRING(tmp, loc); } option\[{int}\] {