Open ntwo1980 opened 7 years ago
The debug macro in parse.c is:
#ifdef EBUG_PARSER #define debug(name) \ fprintf(stderr, "\n\e[90m%s\e[0m\n", name); \ luna_token_inspect(&self->lex->tok); #else #define debug(name) #endif
But following debug statement will crash because the self->lex->tok hasn't been assigned a valid token.
static luna_block_node_t * program(luna_parser_t *self) { debug("program"); ... }
Can the debug macro be changed to:
#ifdef EBUG_PARSER #define debug(name) \ fprintf(stderr, "\n\e[90m%s\e[0m\n", name); \ if(self->lex->offset) \ luna_token_inspect(&self->lex->tok); #else #define debug(name) #endif
The debug macro in parse.c is:
But following debug statement will crash because the self->lex->tok hasn't been assigned a valid token.
Can the debug macro be changed to: