diff options
author | Tianyi Liang <tianyi-liang@uiowa.edu> | 2014-02-11 22:50:08 -0600 |
---|---|---|
committer | Tianyi Liang <tianyi-liang@uiowa.edu> | 2014-02-11 22:50:08 -0600 |
commit | d5e776a4119ee765b21cfc2f3c31abcd1c07d4e8 (patch) | |
tree | cf8d6e362ace06b4af4f062fe8f21c9114060919 /src/util | |
parent | cbf8dffcd17e70d4d4c7d8d1e57bcb16317d246f (diff) |
lexer fix: disable smt-lib conversion for string literals
Diffstat (limited to 'src/util')
-rw-r--r-- | src/util/regexp.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/util/regexp.h b/src/util/regexp.h index 10c8ba2b9..4c69592d4 100644 --- a/src/util/regexp.h +++ b/src/util/regexp.h @@ -124,8 +124,8 @@ private: } } } else { - //throw CVC4::Exception( "Error String Literal: \"" + s + "\"" ); - d_str.push_back( convertCharToUnsignedInt('\\') ); + throw CVC4::Exception( "should be handled by lexer: \"" + s + "\"" ); + //d_str.push_back( convertCharToUnsignedInt('\\') ); } } else { d_str.push_back( convertCharToUnsignedInt(s[i]) ); @@ -242,7 +242,7 @@ public: char c = convertUnsignedIntToChar( d_str[i] ); if(isprint( c )) { if(c == '\\') { - str += "\\"; + str += "\\\\"; } else if(c == '\"') { str += "\\\""; } else { @@ -261,6 +261,9 @@ public: case '\e': s = "\\e"; break; default : { std::string s2 = static_cast<std::ostringstream*>( &(std::ostringstream() << (int)c) )->str(); + if(s2.size() == 1) { + s2 = "0" + s2; + } s = "\\x" + s2; } } |