From 0149122cd026aa96937b6442cd5311b22bbd0915 Mon Sep 17 00:00:00 2001 From: Rangi42 Date: Mon, 14 Jul 2025 10:25:47 -0400 Subject: [PATCH] Note how to print lexed token names for future reference --- src/asm/lexer.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/asm/lexer.cpp b/src/asm/lexer.cpp index fa7601e0..56e4fc27 100644 --- a/src/asm/lexer.cpp +++ b/src/asm/lexer.cpp @@ -2362,6 +2362,9 @@ yy::parser::symbol_type yylex() { lexerState->lastToken = token.type; lexerState->atLineStart = token.type == T_(NEWLINE) || token.type == T_(EOB); + // Uncomment this if you want to debug what the lexer is lexing: + // fprintf(stderr, "{lexing %s}\n", yy::parser::symbol_type(token.type).name()); + if (std::holds_alternative(token.value)) { return yy::parser::symbol_type(token.type, std::get(token.value)); } else if (std::holds_alternative(token.value)) {