From: Tomek Mrugalski Date: Fri, 30 Oct 2015 13:18:19 +0000 (+0900) Subject: [4088] Minor tweaks in lexer.ll X-Git-Tag: trac4088fd_base~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=49814e67e5fd32ad1d1a1f67e11ac43bd319153e;p=thirdparty%2Fkea.git [4088] Minor tweaks in lexer.ll --- diff --git a/src/lib/eval/lexer.ll b/src/lib/eval/lexer.ll index 8fa31eed27..9bcc58d495 100644 --- a/src/lib/eval/lexer.ll +++ b/src/lib/eval/lexer.ll @@ -122,6 +122,7 @@ option\[{int}\] { // Let's get rid of all the text before [, including [. tmp = tmp.substr(pos + 1); + // And finally remove the trailing ]. pos = tmp.find("]"); if (pos == std::string::npos) { driver.error(loc, "The string matched (" + tmp + ") is invalid," @@ -143,7 +144,7 @@ option\[{int}\] { /// @todo: Maybe add a flag somewhere in EvalContext to indicate if we're /// running in v4 (allowed max 255) or v6 (allowed max 65535). if (n<0 || n>65535) { - driver.error(loc, "Option code has invalid values:[" + + driver.error(loc, "Option code has invalid value in " + std::string(yytext) + ". Allowed range: 0..65535"); } @@ -156,7 +157,7 @@ option\[{int}\] { ")" return isc::eval::EvalParser::make_RPAREN(loc); "," return isc::eval::EvalParser::make_COMA(loc); -. driver.error (loc, "invalid character"); +. driver.error (loc, "Invalid character: " + std::string(yytext)); <> return isc::eval::EvalParser::make_END(loc); %%