Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid GCC-7 & above compiler warning: -Wimplicit-fallthrough #9

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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<EdnToken> lex(string ednString)

EdnNode read(string ednString)
Expand Down Expand Up @@ -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
Expand All @@ -99,6 +101,7 @@ Which is nice when proving things are parsing as you expect.
list<EdnNode> values #used for collections

##enums

TokenType
TokenString
TokenAtom
Expand All @@ -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.
make pprint actually format as demonstrated above. Right now it is just a single string with out the indentation.
7 changes: 2 additions & 5 deletions edn.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down