File tree 5 files changed +22
-18
lines changed
5 files changed +22
-18
lines changed Original file line number Diff line number Diff line change 18
18
#include " format_type.h"
19
19
#include " ieee_float.h"
20
20
#include " invariant.h"
21
- #include " lispexpr.h"
22
21
#include " mp_arith.h"
23
22
#include " rational.h"
24
23
#include " rational_tools.h"
25
24
#include " std_code.h"
26
25
#include " std_expr.h"
27
26
#include " string2int.h"
27
+ #include " string_utils.h"
28
28
29
29
#include < ostream>
30
30
#include < stack>
Original file line number Diff line number Diff line change 8
8
9
9
#include " lispexpr.h"
10
10
11
+ #include " string_utils.h"
12
+
11
13
#include < iostream>
12
14
13
15
std::string lispexprt::expr2string () const
@@ -147,21 +149,6 @@ bool lispexprt::parse(
147
149
return false ;
148
150
}
149
151
150
- std::string escape (const std::string &s)
151
- {
152
- std::string result;
153
-
154
- for (std::size_t i=0 ; i<s.size (); i++)
155
- {
156
- if (s[i]==' \\ ' || s[i]==' "' )
157
- result+=' \\ ' ;
158
-
159
- result+=s[i];
160
- }
161
-
162
- return result;
163
- }
164
-
165
152
int test_lispexpr ()
166
153
{
167
154
std::string line;
Original file line number Diff line number Diff line change @@ -99,8 +99,6 @@ inline std::ostream &operator<<(
99
99
return out << expr.expr2string ();
100
100
}
101
101
102
- std::string escape (const std::string &s);
103
-
104
102
int test_lispexpr ();
105
103
106
104
#endif // CPROVER_UTIL_LISPEXPR_H
Original file line number Diff line number Diff line change @@ -133,3 +133,18 @@ std::string trim_from_last_delimiter(
133
133
result=s.substr (0 , index );
134
134
return result;
135
135
}
136
+
137
+ std::string escape (const std::string &s)
138
+ {
139
+ std::string result;
140
+
141
+ for (std::size_t i=0 ; i<s.size (); i++)
142
+ {
143
+ if (s[i]==' \\ ' || s[i]==' "' )
144
+ result+=' \\ ' ;
145
+
146
+ result+=s[i];
147
+ }
148
+
149
+ return result;
150
+ }
Original file line number Diff line number Diff line change @@ -63,4 +63,8 @@ Stream &join_strings(
63
63
return os;
64
64
}
65
65
66
+ // / Generic escaping of strings; this is not meant to be a particular
67
+ // / programming language.
68
+ std::string escape (const std::string &);
69
+
66
70
#endif
You can’t perform that action at this time.
0 commit comments