From aa76603da9a1c04835f4a431251f77d481c26bdb Mon Sep 17 00:00:00 2001 From: ISSOtm Date: Mon, 17 Aug 2020 18:12:21 +0200 Subject: [PATCH] Add line+col trace info to lexer --- src/asm/lexer.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/asm/lexer.c b/src/asm/lexer.c index 89c52880..15483226 100644 --- a/src/asm/lexer.c +++ b/src/asm/lexer.c @@ -1377,7 +1377,8 @@ static char const *reportGarbageChar(unsigned char firstByte) 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_NORMAL(void) 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;