Browse Source

[4088] Minor tweaks in lexer.ll

Tomek Mrugalski 9 years ago
parent
commit
49814e67e5
1 changed files with 3 additions and 2 deletions
  1. 3 2
      src/lib/eval/lexer.ll

+ 3 - 2
src/lib/eval/lexer.ll

@@ -122,6 +122,7 @@ option\[{int}\] {
     // Let's get rid of all the text before [, including [.
     // Let's get rid of all the text before [, including [.
     tmp = tmp.substr(pos + 1);
     tmp = tmp.substr(pos + 1);
 
 
+    // And finally remove the trailing ].
     pos = tmp.find("]");
     pos = tmp.find("]");
     if (pos == std::string::npos) {
     if (pos == std::string::npos) {
         driver.error(loc, "The string matched (" + tmp + ") is invalid,"
         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
     /// @todo: Maybe add a flag somewhere in EvalContext to indicate if we're
     /// running in v4 (allowed max 255) or v6 (allowed max 65535).
     /// running in v4 (allowed max 255) or v6 (allowed max 65535).
     if (n<0 || n>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");
                      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_RPAREN(loc);
 ","         return isc::eval::EvalParser::make_COMA(loc);
 ","         return isc::eval::EvalParser::make_COMA(loc);
 
 
-.          driver.error (loc, "invalid character");
+.          driver.error (loc, "Invalid character: " + std::string(yytext));
 <<EOF>>    return isc::eval::EvalParser::make_END(loc);
 <<EOF>>    return isc::eval::EvalParser::make_END(loc);
 %%
 %%