Getting rid of globals

This commit is contained in:
Krzosa Karol
2023-01-01 14:17:37 +01:00
parent c238e5ba46
commit 647958b72d
9 changed files with 62 additions and 52 deletions

View File

@@ -33,7 +33,7 @@ print_token_line(Token *token){
log_info_no_nl("%.*s", i1, token->line_begin);
// Print token part
if(color_codes_enabled){
if(pctx->color_codes_enabled){
log_info_no_nl( PRINTF_RED "%.*s" PRINTF_RESET, (int)token->len, token->str);
} else {
log_info_no_nl("%.*s", (int)token->len, token->str);
@@ -105,7 +105,7 @@ CORE_Static Token *
token_get(S64 i = 0){
i += pctx->token_iter;
if(i >= pctx->tokens.len){
return &null_token;
return &pctx->null_token;
}
Token *result = &pctx->tokens[i];
return result;