Add line+col trace info to lexer

This commit is contained in:
ISSOtm
2020-08-17 18:12:21 +02:00
parent b83b9825f8
commit aa76603da9

View File

@@ -1377,7 +1377,8 @@ static char const *reportGarbageChar(unsigned char firstByte)
static int yylex_NORMAL(void) 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 (;;) { for (;;) {
int c = nextChar(); int c = nextChar();
@@ -1620,7 +1621,8 @@ static int yylex_NORMAL(void)
static int yylex_RAW(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` */ /* This is essentially a modified `readString` */
size_t i = 0; size_t i = 0;