File tree Expand file tree Collapse file tree 5 files changed +22
-18
lines changed Expand file tree Collapse file tree 5 files changed +22
-18
lines changed Original file line number Diff line number Diff line change 1818#include " format_type.h"
1919#include " ieee_float.h"
2020#include " invariant.h"
21- #include " lispexpr.h"
2221#include " mp_arith.h"
2322#include " rational.h"
2423#include " rational_tools.h"
2524#include " std_code.h"
2625#include " std_expr.h"
2726#include " string2int.h"
27+ #include " string_utils.h"
2828
2929#include < ostream>
3030#include < stack>
Original file line number Diff line number Diff line change 88
99#include " lispexpr.h"
1010
11+ #include " string_utils.h"
12+
1113#include < iostream>
1214
1315std::string lispexprt::expr2string () const
@@ -147,21 +149,6 @@ bool lispexprt::parse(
147149 return false ;
148150}
149151
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-
165152int test_lispexpr ()
166153{
167154 std::string line;
Original file line number Diff line number Diff line change @@ -99,8 +99,6 @@ inline std::ostream &operator<<(
9999 return out << expr.expr2string ();
100100}
101101
102- std::string escape (const std::string &s);
103-
104102int test_lispexpr ();
105103
106104#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(
133133 result=s.substr (0 , index);
134134 return result;
135135}
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(
6363 return os;
6464}
6565
66+ // / Generic escaping of strings; this is not meant to be a particular
67+ // / programming language.
68+ std::string escape (const std::string &);
69+
6670#endif
You can’t perform that action at this time.
0 commit comments