Merge pull request #5019 from JakubValtar/fix-comment-scrub

Scrub comments: skip the second chracter in the escape sequence
This commit is contained in:
Ben Fry
2017-04-21 17:23:36 -04:00
committed by GitHub

View File

@@ -730,10 +730,16 @@ public class PdePreprocessor {
throw new RuntimeException("Missing the */ from the end of a " +
"/* comment */");
}
} else if (p[index] == '"' && index > 0 && p[index-1] != '\\') {
// switch in/out of quoted region
} else if (p[index] == '"') {
insideQuote = !insideQuote;
index++;
// skip the escaped char
} else if (insideQuote && p[index] == '\\') {
index += 2;
} else { // any old character, move along
index++;
}