summaryrefslogtreecommitdiff
path: root/src/util/regexp.h
diff options
context:
space:
mode:
authorTianyi Liang <tianyi-liang@uiowa.edu>2014-02-11 22:50:08 -0600
committerTianyi Liang <tianyi-liang@uiowa.edu>2014-02-11 22:50:08 -0600
commitd5e776a4119ee765b21cfc2f3c31abcd1c07d4e8 (patch)
treecf8d6e362ace06b4af4f062fe8f21c9114060919 /src/util/regexp.h
parentcbf8dffcd17e70d4d4c7d8d1e57bcb16317d246f (diff)
lexer fix: disable smt-lib conversion for string literals
Diffstat (limited to 'src/util/regexp.h')
-rw-r--r--src/util/regexp.h9
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;
}
}
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback