diff --git a/analyser/scope.c2 b/analyser/scope.c2 index 0c5c5649b..1ed429ed6 100644 --- a/analyser/scope.c2 +++ b/analyser/scope.c2 @@ -106,10 +106,8 @@ public fn void Scope.reset(Scope* s) { fn void Scope.addImports(Scope* s) { // Note: this also adds the module itself (import[0]) - u32 num_imports = s.imports.size(); - ast.ImportDecl** imports = s.imports.getDecls(); - for (u32 i=0; i 1) out.newline(); - Decl** types = a.types.getDecls(); for (u32 i=0; i const ptr-ptr is fixed in analyser - return (const FunctionDecl**)d.struct_functions; +fn FunctionDecl* StructTypeDecl.getStructFunction(const StructTypeDecl* d, u32 i) { + return d.struct_functions[i]; } fn u32 StructTypeDecl.getNumStructFunctions(const StructTypeDecl* d) { diff --git a/ast/symbol_table.c2 b/ast/symbol_table.c2 index ffec898bd..3ea9c8a16 100644 --- a/ast/symbol_table.c2 +++ b/ast/symbol_table.c2 @@ -46,8 +46,8 @@ public fn u32 SymbolTable.size(const SymbolTable* t) { return t.num_public + t.num_private; } -public fn Decl** SymbolTable.getDecls(const SymbolTable* t) { - return t.decls; +public fn Decl* SymbolTable.get(const SymbolTable* t, u32 i) { + return t.decls[i]; } fn void SymbolTable.resize(SymbolTable* t, u32 capacity) { @@ -124,9 +124,8 @@ public fn void SymbolTable.print(const SymbolTable* t, string_buffer.Buf* out) { out.newline(); if (d.isStructType()) { StructTypeDecl* std = (StructTypeDecl*)d; - const FunctionDecl** fds = std.getStructFunctions(); for (u32 j=0; j