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

@@ -192,10 +192,10 @@ token_make(Core_Ctx *lexer){
CORE_Static Token *
lex_last_indent_token(Lex_Stream *s){
if(s->indent_stack.len > 0){
if (s->indent_stack.len > 0) {
return *s->indent_stack.last();
}
return &token_null;
return &pctx->same_scope_token;
}
CORE_Static B32
@@ -594,7 +594,7 @@ lex_restream(Core_Ctx *lexer, String istream, String file){
Scratch_Scope _scope(lexer->scratch);
lexer->stream.indent_stack.allocator = lexer->scratch;
lexer->stream.indent_stack.add(&token_null);
lexer->stream.indent_stack.add(&lexer->same_scope_token);
lex__stream(lexer);
}