Change name Scratch_Scope to Scoped_Arena

This commit is contained in:
Krzosa Karol
2023-03-31 17:39:00 +02:00
parent 277404fe95
commit b2e8012afa
12 changed files with 33 additions and 32 deletions

View File

@@ -219,7 +219,7 @@ gen_value(Token *pos, Value a) {
switch (type->kind) {
CASE_INT : {
Scratch_Scope scratch(pctx->scratch);
Scoped_Arena scratch(pctx->scratch);
String postfix = get_type_postfix(type);
const char *string = bigint_to_error_string(scratch.arena, &a.big_int_val, 10);
gen("%s%Q", string, postfix);
@@ -560,7 +560,7 @@ gen_ast(Ast *ast) {
CASE(RETURN, Return) {
if (is_tuple(node->resolved_type)) {
Scratch_Scope scratch(pctx->scratch);
Scoped_Arena scratch(pctx->scratch);
Intern_String tuple_name = get_unique_name(node);
gen_simple_decl(node->resolved_type, tuple_name);
@@ -799,7 +799,7 @@ gen_ast(Ast *ast) {
For(node->vars)
gen_ast(it);
Scratch_Scope scratch(pctx->scratch);
Scoped_Arena scratch(pctx->scratch);
Intern_String var_name = get_unique_name(node);
gen_simple_decl(node->resolved_type, var_name);
@@ -1034,7 +1034,7 @@ compile_to_c_code() {
// Generate slice and tuple types
For_Named(pctx->all_types, type) {
Scratch_Scope scratch(pctx->scratch);
Scoped_Arena scratch(pctx->scratch);
if (type->kind == TYPE_SLICE) {
genln("typedef struct Slice%llu{", type->type_id);