shithub: rgbds

Download patch

ref: 861cb552c4edb52f1ed87ea5fab39f863526cb43
parent: 417cceb0de454dd5312176e006cd41af6a6f0f4e
author: Rangi <remy.oukaour+rangi42@gmail.com>
date: Fri Dec 11 14:23:49 EST 2020

discardBlockComment sets lexerState->disableMacroArgs = true, like discardComment

--- a/src/asm/lexer.c
+++ b/src/asm/lexer.c
@@ -926,11 +926,12 @@
 static void discardBlockComment(void)
 {
 	dbgPrint("Discarding block comment\n");
+	lexerState->disableMacroArgs = true;
 	for (;;) {
 		switch (nextChar()) {
 		case EOF:
 			error("Unterminated block comment\n");
-			return;
+			goto finish;
 		case '/':
 			if (peek(0) == '*') {
 				warning(WARNING_NESTED_COMMENT,
@@ -940,7 +941,7 @@
 		case '*':
 			if (peek(0) == '/') {
 				shiftChars(1);
-				return;
+				goto finish;
 			}
 			/* fallthrough */
 		default:
@@ -947,6 +948,8 @@
 			continue;
 		}
 	}
+finish:
+	lexerState->disableMacroArgs = false;
 }
 
 /* Function to discard all of a line's comments */