Skip to content

Commit

Permalink
Merge pull request pboyer#32 from nburles/fix-whitespace-escape
Browse files Browse the repository at this point in the history
Leave spaces alone unless escaped spaces requested
  • Loading branch information
mike-lischke committed Aug 2, 2016
2 parents 183b7ce + db8339b commit 50d1f2c
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions runtime/Cpp/runtime/src/support/CPPUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,6 @@ namespace antlrcpp {
std::string result;
for (auto c : str) {
switch (c) {
case ' ':
if (escapeSpaces) {
result += "·";
break;
} else {
// fall through
}

case '\n':
result += "\\n";
break;
Expand All @@ -77,6 +69,13 @@ namespace antlrcpp {
result += "\\t";
break;

case ' ':
if (escapeSpaces) {
result += "·";
break;
}
// else fall through

default:
result += c;
}
Expand Down

0 comments on commit 50d1f2c

Please sign in to comment.