mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 10:12:06 +00:00
Note how to print lexed token names for future reference
This commit is contained in:
@@ -2362,6 +2362,9 @@ yy::parser::symbol_type yylex() {
|
|||||||
lexerState->lastToken = token.type;
|
lexerState->lastToken = token.type;
|
||||||
lexerState->atLineStart = token.type == T_(NEWLINE) || token.type == T_(EOB);
|
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<uint32_t>(token.value)) {
|
if (std::holds_alternative<uint32_t>(token.value)) {
|
||||||
return yy::parser::symbol_type(token.type, std::get<uint32_t>(token.value));
|
return yy::parser::symbol_type(token.type, std::get<uint32_t>(token.value));
|
||||||
} else if (std::holds_alternative<std::string>(token.value)) {
|
} else if (std::holds_alternative<std::string>(token.value)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user