mirror of
https://github.com/Z3Prover/z3
synced 2025-06-28 17:08:45 +00:00
pretty-printing of general escape sequences for string literals
This commit is contained in:
parent
889b6be2c3
commit
1fa8129c8f
1 changed files with 8 additions and 2 deletions
|
@ -341,8 +341,14 @@ format * smt2_pp_environment::pp_str_literal(app * t) {
|
||||||
} else if (c == '\\') {
|
} else if (c == '\\') {
|
||||||
buf << "\\" << "\\";
|
buf << "\\" << "\\";
|
||||||
} else {
|
} else {
|
||||||
// TODO general hex escape
|
// general hex escape
|
||||||
NOT_IMPLEMENTED_YET();
|
buf << "\\x";
|
||||||
|
unsigned int cVal = (unsigned int)c;
|
||||||
|
const char convtable[16] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};
|
||||||
|
unsigned int highPart = cVal / 16;
|
||||||
|
unsigned int lowPart = cVal % 16;
|
||||||
|
SASSERT(highPart < 16); SASSERT(lowPart < 16);
|
||||||
|
buf << convtable[highPart] << convtable[lowPart];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue