mirror of
https://github.com/Z3Prover/z3
synced 2025-06-06 06:03:23 +00:00
patch
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
e14e3ef291
commit
5cb0bac41d
2 changed files with 5 additions and 3 deletions
|
@ -33,7 +33,7 @@ static bool is_hex_digit(char ch, unsigned& d) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool zstring::is_escape_char(char const *& s, unsigned& result) {
|
bool zstring::is_escape_char(bool from_input, char const *& s, unsigned& result) {
|
||||||
unsigned d;
|
unsigned d;
|
||||||
if (*s == '\\' && s[1] == 'u' && s[2] == '{' && s[3] != '}') {
|
if (*s == '\\' && s[1] == 'u' && s[2] == '{' && s[3] != '}') {
|
||||||
result = 0;
|
result = 0;
|
||||||
|
@ -55,6 +55,8 @@ bool zstring::is_escape_char(char const *& s, unsigned& result) {
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
if (!from_input)
|
||||||
|
return false;
|
||||||
unsigned d1, d2, d3, d4;
|
unsigned d1, d2, d3, d4;
|
||||||
if (*s == '\\' && s[1] == 'u' &&
|
if (*s == '\\' && s[1] == 'u' &&
|
||||||
is_hex_digit(s[2], d1) &&
|
is_hex_digit(s[2], d1) &&
|
||||||
|
@ -76,7 +78,7 @@ bool zstring::is_escape_char(char const *& s, unsigned& result) {
|
||||||
zstring::zstring(char const* s, bool from_input) {
|
zstring::zstring(char const* s, bool from_input) {
|
||||||
while (*s) {
|
while (*s) {
|
||||||
unsigned ch = 0;
|
unsigned ch = 0;
|
||||||
if (from_input && is_escape_char(s, ch)) {
|
if (is_escape_char(from_input, s, ch)) {
|
||||||
m_buffer.push_back(ch);
|
m_buffer.push_back(ch);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
|
@ -25,7 +25,7 @@ private:
|
||||||
buffer<unsigned> m_buffer;
|
buffer<unsigned> m_buffer;
|
||||||
bool well_formed() const;
|
bool well_formed() const;
|
||||||
bool uses_unicode() const;
|
bool uses_unicode() const;
|
||||||
bool is_escape_char(char const *& s, unsigned& result);
|
bool is_escape_char(bool from_input, char const *& s, unsigned& result);
|
||||||
public:
|
public:
|
||||||
static unsigned unicode_max_char() { return 196607; }
|
static unsigned unicode_max_char() { return 196607; }
|
||||||
static unsigned unicode_num_bits() { return 18; }
|
static unsigned unicode_num_bits() { return 18; }
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue