mirror of
https://github.com/Z3Prover/z3
synced 2025-04-08 18:31:49 +00:00
round-tripping escapes, again #5519
This commit is contained in:
parent
90f98d5791
commit
f91c3d9fd6
|
@ -190,7 +190,7 @@ extern "C" {
|
|||
if (ch <= 32 || ch >= 127) {
|
||||
buff.reset();
|
||||
buffer.push_back('\\');
|
||||
buffer.push_back('\\'); // possibly replace by native non-escaped version?
|
||||
// buffer.push_back('\\'); // possibly replace by native non-escaped version?
|
||||
buffer.push_back('u');
|
||||
buffer.push_back('{');
|
||||
while (ch > 0) {
|
||||
|
|
|
@ -10706,12 +10706,11 @@ def is_string_value(a):
|
|||
"""
|
||||
return isinstance(a, SeqRef) and a.is_string_value()
|
||||
|
||||
|
||||
def StringVal(s, ctx=None):
|
||||
"""create a string expression"""
|
||||
s = "".join(str(ch) if ord(ch) < 128 else "\\u{%x}" % (ord(ch)) for ch in s)
|
||||
s = "".join(str(ch) if 32 <= ord(ch) and ord(ch) < 127 else "\\u{%x}" % (ord(ch)) for ch in s)
|
||||
ctx = _get_ctx(ctx)
|
||||
return SeqRef(Z3_mk_lstring(ctx.ref(), len(s), s), ctx)
|
||||
return SeqRef(Z3_mk_string(ctx.ref(), s), ctx)
|
||||
|
||||
|
||||
def String(name, ctx=None):
|
||||
|
|
Loading…
Reference in a new issue