diff --git a/README.md b/README.md index 6afeb5a..41df349 100644 --- a/README.md +++ b/README.md @@ -60,6 +60,7 @@ If you define DEBUG you will see debug output when using pprint. This looks like Which is nice when proving things are parsing as you expect. ##api + list lex(string ednString) EdnNode read(string ednString) @@ -87,6 +88,7 @@ Which is nice when proving things are parsing as you expect. EdnNode handleTagged(EdnToken token, EdnNode value) ##structs + EdnToken TokenType type int line @@ -99,6 +101,7 @@ Which is nice when proving things are parsing as you expect. list values #used for collections ##enums + TokenType TokenString TokenAtom @@ -122,4 +125,4 @@ Which is nice when proving things are parsing as you expect. ##todo -make pprint actually format as demonstrated above. Right now it is just a single string with out the indentation. \ No newline at end of file +make pprint actually format as demonstrated above. Right now it is just a single string with out the indentation. diff --git a/edn.hpp b/edn.hpp index 7aa2edd..3355d88 100644 --- a/edn.hpp +++ b/edn.hpp @@ -384,13 +384,10 @@ namespace edn { after.reserve(before.length() + 4); for (string::size_type i = 0; i < before.length(); ++i) { - switch (before[i]) { - case '"': - case '\\': + if (before[i] == '"' || before[i] == '\\') { after += '\\'; - default: - after += before[i]; } + after += before[i]; } return after; }