Merge pull request #370 from jidoc01/fix_bug

Fix comment bug
This commit is contained in:
Antonio Niño Díaz
2019-07-06 11:10:17 +01:00
committed by GitHub

View File

@@ -234,16 +234,10 @@ YY_BUFFER_STATE yy_create_buffer(FILE *f)
/* Convert all line endings to LF and spaces */ /* Convert all line endings to LF and spaces */
char *mem = pBuffer->pBuffer; char *mem = pBuffer->pBuffer;
uint32_t instring = 0;
while (*mem) { while (*mem) {
if (*mem == '\"')
instring = 1 - instring;
if ((mem[0] == '\\') && (mem[1] == '\"' || mem[1] == '\\')) { if ((mem[0] == '\\') && (mem[1] == '\"' || mem[1] == '\\')) {
mem += 2; mem += 2;
} else if (instring) {
mem += 1;
} else { } else {
/* LF CR and CR LF */ /* LF CR and CR LF */
if (((mem[0] == 10) && (mem[1] == 13)) if (((mem[0] == 10) && (mem[1] == 13))
@@ -264,7 +258,7 @@ YY_BUFFER_STATE yy_create_buffer(FILE *f)
/* Remove comments */ /* Remove comments */
mem = pBuffer->pBuffer; mem = pBuffer->pBuffer;
instring = 0; uint32_t instring = 0;
while (*mem) { while (*mem) {
if (*mem == '\"') if (*mem == '\"')