From cef65063cec641a93973b38a48e100fdd115db44 Mon Sep 17 00:00:00 2001 From: Patrick Simianer
Date: Sat, 23 Aug 2014 22:59:16 +0100 Subject: rewritten grammar --- fast/util.hh | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) (limited to 'fast/util.hh') diff --git a/fast/util.hh b/fast/util.hh index 2a28f16..c3e087e 100644 --- a/fast/util.hh +++ b/fast/util.hh @@ -7,23 +7,24 @@ using namespace std; namespace util { - inline string - json_escape(const string& s) { // FIXME: only inline? - ostringstream os; - for (auto it = s.cbegin(); it != s.cend(); it++) { - switch (*it) { - case '"': os << "\\\""; break; - case '\\': os << "\\\\"; break; - case '\b': os << "\\b"; break; - case '\f': os << "\\f"; break; - case '\n': os << "\\n"; break; - case '\r': os << "\\r"; break; - case '\t': os << "\\t"; break; - default: os << *it; break; - } - } - return os.str(); - }; +inline string +json_escape(const string& s) { // FIXME: only inline? + ostringstream os; + for (auto it = s.cbegin(); it != s.cend(); it++) { + switch (*it) { + case '"': os << "\\\""; break; + case '\\': os << "\\\\"; break; + case '\b': os << "\\b"; break; + case '\f': os << "\\f"; break; + case '\n': os << "\\n"; break; + case '\r': os << "\\r"; break; + case '\t': os << "\\t"; break; + default: os << *it; break; + } + } + + return os.str(); +} } // namespace util -- cgit v1.2.3