shithub: rgbds

Download patch

ref: dfdb1071051b28608d178f3611332db1e299d105
parent: 9f598dfdb785d6464d18ffa84801be1c9491d474
parent: 38110a833d66bc4560e7cb864e11105a52cf974f
author: Antonio Niño Díaz <[email protected]>
date: Sat Jul 6 07:10:17 EDT 2019

Merge pull request #370 from jidoc01/fix_bug

Fix comment bug

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