case '\\': {d_str.push_back( convertCharToUnsignedInt('\\') );i++;} break;\r
case 'x': {\r
if(i + 2 < s.size()) {\r
- if((isdigit(s[i+1]) || (s[i+1] >= 'a' && s[i+1] <= 'f') || (s[i+1] >= 'A' && s[i+1] <= 'F')) &&\r
- (isdigit(s[i+2]) || (s[i+2] >= 'a' && s[i+2] <= 'f') || (s[i+2] >= 'A' && s[i+2] <= 'F'))) {\r
- d_str.push_back( convertCharToUnsignedInt( hexToDec(s[i+1]) * 16 + hexToDec(s[i+2]) ) );\r
- i += 3;\r
- } else {\r
- throw CVC4::Exception( "Error String Literal: \"" + s + "\"" );\r
- }\r
+ if(isxdigit(s[i+1]) && isxdigit(s[i+2])) {\r
+ d_str.push_back( convertCharToUnsignedInt( hexToDec(s[i+1]) * 16 + hexToDec(s[i+2]) ) );\r
+ i += 3;\r
+ } else {\r
+ throw CVC4::Exception( "Illegal String Literal: \"" + s + "\"" );\r
+ }\r
} else {\r
- throw CVC4::Exception( "Error String Literal: \"" + s + "\"" );\r
+ throw CVC4::Exception( "Illegal String Literal: \"" + s + "\", must have two digits after \\x" );\r
}\r
}\r
break;\r
d_str.push_back( convertCharToUnsignedInt((char)num) );\r
i++;\r
}\r
+ } else if((unsigned)s[i] > 127) {\r
+ throw CVC4::Exception( "Illegal String Literal: \"" + s + "\", must use escaped sequence" );\r
} else {\r
d_str.push_back( convertCharToUnsignedInt(s[i]) );\r
i++;\r
throw CVC4::Exception( "should be handled by lexer: \"" + s + "\"" );\r
//d_str.push_back( convertCharToUnsignedInt('\\') );\r
}\r
+ } else if((unsigned)s[i] > 127) {\r
+ throw CVC4::Exception( "Illegal String Literal: \"" + s + "\", must use escaped sequence" );\r
} else {\r
d_str.push_back( convertCharToUnsignedInt(s[i]) );\r
i++;\r