shithub: rgbds

Download patch

ref: aa76603da9a1c04835f4a431251f77d481c26bdb
parent: b83b9825f81e99414df95b000df0fd47d55004aa
author: ISSOtm <[email protected]>
date: Mon Aug 17 14:12:21 EDT 2020

Add line+col trace info to lexer

--- a/src/asm/lexer.c
+++ b/src/asm/lexer.c
@@ -1377,7 +1377,8 @@
 
 static int yylex_NORMAL(void)
 {
-	dbgPrint("Lexing in normal mode\n");
+	dbgPrint("Lexing in normal mode, line=%" PRIu32 ", col=%" PRIu32 "\n",
+		 lexer_GetLineNo(), lexer_GetColNo());
 	for (;;) {
 		int c = nextChar();
 
@@ -1620,7 +1621,8 @@
 
 static int yylex_RAW(void)
 {
-	dbgPrint("Lexing in raw mode\n");
+	dbgPrint("Lexing in raw mode, line=%" PRIu32 ", col=%" PRIu32 "\n",
+		 lexer_GetLineNo(), lexer_GetColNo());
 
 	/* This is essentially a modified `readString` */
 	size_t i = 0;