We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 86e7e9b commit 62d128eCopy full SHA for 62d128e
1 file changed
src/PEG.cpp
@@ -336,15 +336,23 @@ std::string PEG::removeComment (const std::string& line)
336
337
while ((character = utf8_next_char (line, i)))
338
{
339
- if (character == '\'' && previous != '\\')
+ if (insideQuote)
340
+ {
341
+ if (character == quote)
342
343
+ quote = 0;
344
+ insideQuote = false;
345
+ }
346
347
+ else if (character == '\'' && previous != '\\')
348
349
quote = '\'';
- insideQuote = ! insideQuote;
350
+ insideQuote = true;
351
}
352
else if (character == '"' && previous != '\\')
353
354
quote = '"';
355
356
357
358
if (character == '#' && previous != '\\' && ! insideQuote)
0 commit comments