3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-08 18:31:49 +00:00

use same quotation mechanism as ast_smt2 parser

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2012-11-19 05:00:02 -08:00
parent 57c4ce4082
commit a94d3a21ee

View file

@ -29,6 +29,7 @@ Revision History:
#include"vector.h"
#include"for_each_ast.h"
#include"decl_collector.h"
#include"smt2_util.h"
// ---------------------------------------
// smt_renaming
@ -67,32 +68,10 @@ symbol smt_renaming::fix_symbol(symbol s, int k) {
return symbol(buffer.str().c_str());
}
buffer << "|";
if (*data == '|') {
while (*data) {
if (*data == '|') {
if (!data[1]) {
break;
}
buffer << "\\";
}
buffer << *data;
++data;
}
}
else {
while (*data) {
if (*data == '|') {
buffer << "\\";
}
buffer << *data;
++data;
}
}
buffer << mk_smt2_quoted_symbol(s);
if (k > 0) {
buffer << k;
}
buffer << "|";
return symbol(buffer.str().c_str());
}